Harryxun/stf_run huggingface dataset:
n, k = [int(i) for i in input().split(" ")]
t = []
d = []

for i in range(0, n):
    x, y = [int(i) for i in input().split(" ")]
    t.append(x)
    d.append(y)

dt = zip(d, t)
dt = sorted(dt, key = lambda k:k[0], reverse=True)
td = [[] for i in range(0, n + 1)]
tp = []
dp = [[0 for j in range(0, k)] for i in range(0, k)]
eaten = [[0 for j in range(0, k)] for i in range(0, k)]

for i in range(0, n):
    td[dt[i][1]].append(dt[i][0])
    if len(td[dt[i][1]]) == 1:
        tp.append(dt[i][1])

dp[0][0] = td[tp[0]][0] + 1
eaten[0][0] = 1

for j in range(1, k):
    if eaten[0][j - 1] < len(td[tp[0]]):
        dp[0][j] = dp[0][j - 1] + td[tp[0]][eaten[0][j - 1]]
        eaten[0][j] = eaten[0][j - 1] + 1
    else:
        break


for i in range(1, len(tp)):
    eaten[i][i] = 1
    dp[i][i] =  dp[i - 1][i - 1] + td[tp[i]][0] + 2 * i + 1
    for j in range(i + 1, k):
        if dp[i - 1][j - 1] == 0 or (eaten[i][j - 1] < len(td[tp[i]]) and 2 * i + 1 + td[tp[i]][0] < td[tp[i]][eaten[i][j - 1]]):
            if eaten[i][j - 1] < len(td[tp[i]]) and dp[i][j - 1] > 0:
                dp[i][j] = dp[i][j - 1] + td[tp[i]][eaten[i][j - 1]]
                eaten[i][j] = eaten[i][j - 1] + 1
        else:
            if dp[i - 1][j - 1] > 0:
                dp[i][j] = dp[i - 1][j - 1] + 2 * i + 1 + td[tp[i]][0]
                eaten[i][j] = 1

print(max([i[-1] for i in dp]))

### FIXED CODE ###

n, k = [int(i) for i in input().split(" ")]
t = []
d = []

for i in range(0, n):
    x, y = [int(i) for i in input().split(" ")]
    t.append(x)
    d.append(y)

dt = zip(d, t)
dt = sorted(dt, key = lambda k:k[0], reverse=True)
t_max = [False for i in range(0, n + 1)]
d_max = []
d_non_max = []

for i in range(0, n):
    if t_max[dt[i][1]]:
        d_non_max.append(dt[i][0])
    else:
        t_max[dt[i][1]] = True
        d_max.append(dt[i][0])
        
p = [0 for i in range(0, len(d_max) + 1)]
sum_max = 0
sum_non_max = sum(d_non_max[0:min(len(d_non_max), k)])

for i in range(1, len(p)):
    sum_max += d_max[i - 1]
    if k - i >= 0 and k - i < len(d_non_max):
        sum_non_max -= d_non_max[k - i]
    if k - i >= 0 and k - i - 1 < len(d_non_max):
        p[i] = sum_max + sum_non_max + i * i
    else:
        p[i] = 0
        
print(max(p))
A=input()
B=input()
if B%A==0:
    print(A+B)
else:
    print(B-A)

### FIXED CODE ###

DATA=input()
DATA=DATA.split(" ")
A=int(DATA[0])
B=int(DATA[1])

if B%A==0:
    print(A+B)
else:
    print(B-A)
nCr = {}
def cmb(n, r):
    if r == 0 or r == n: return 1
    if r == 1: return n
    if (n,r) in nCr: return nCr[(n,r)]
    
    nCr[(n,r)] = cmb(n-1,r) + cmb(n-1,r-1)
    return nCr[(n,r)]

h, w, a, b = map( int, input().split() )

ans = 0
mod_parent = 10**9 + 7
for i in range( a+1 ) :
  ans += ( cmb( b+h-a, i ) %  mod_parent ) + ( cmb( h+w-b, h-i ) %  mod_parent )
print( ans )

### FIXED CODE ###

h, w, a, b = map( int, input().split() )

SIZE = h+w+2
MOD = 10**9 + 7
MOD_Farmer = 10**9+5

fact = [0] * SIZE
inv = [0] * SIZE
fact_inv = [0] * SIZE

# prepare --------------------------------
inv[0] = 0
inv[1] = 1
fact[0] = fact[1] = 1
fact_inv[0] = fact_inv[1] = 1
for i in range( 2, SIZE ):
  inv[i] = MOD - (MOD//i)*inv[MOD%i]%MOD
  fact[i] = fact[i-1] * i % MOD
  fact_inv[i] = fact_inv[i-1] * inv[i] % MOD
#  fact_inv[i] = fact[i] **( 10**4 ) \
#              * fact[i] **( 10**5 ) \
#              * fact[i] ** 5 % MOD % MOD
# ----------------------------------------
def comb( n, r ):
  if r >= 0 and n >= 0:
    return fact[n] * fact_inv[n-r]%MOD * fact_inv[r]%MOD
  else :
    return 0.0
# ----------------------------------------

#print( fact_inv )

ans = 0
for i in range( h-a ):
    ans += comb(i+b-1, b-1) * comb(h-i-1+w-b-1,w-b-1)
    ans %= MOD
print( ans )
import math

n,k = map(int,input().split())

ans = 0
for val in range(1,n+1):
    #print(val,",",math.log2(k)-math.log2(val))
    x = math.ceil(math.log2(k)-math.log2(val))
    ans = ans + 1/n * (1/2)**x 
print(ans)


### FIXED CODE ###

import math

n, k = map( int, input().split())
 
ans = 0
for i in range(1, n + 1):
  a = max( 0 , math.ceil(math.log( k / i, 2 )))
  ans += ( 1 / n ) * ( 0.5 ** a )
print(ans)
N = int(input())
MOD = 10 ** 9 + 7
x = 1
for i in range(2, N + 1):
  x *= i

count = 1
for i in range(2, N + 1):
  if x % i != 0:
    continue
  count = 1
  while x % i == 0:
    x //= i
    count += 1
  ans *= count
print(ans % MOD)

### FIXED CODE ###

N = int(input())
MOD = 10 ** 9 + 7
x = 1
for i in range(2, N + 1):
  x *= i

count = 1
ans = 1
for i in range(2, N + 1):
  if x % i != 0:
    continue
  count = 1
  while x % i == 0:
    x //= i
    count += 1
  ans *= count
print(ans % MOD)
from collections import defaultdict
from _bisect import bisect_right

s,t=input(),input()
m=len(s)

if set(s)&set(t)!=set(t):print(-1);exit()

dict=defaultdict(list)
for i,j in enumerate(s):
    dict[j] +=[i+1]

ans,index=0,0
for i in t:
    point=bisect_right(dict[i],index)
    if point==len(dict[i]):num=dict[i][0]
    else:num=dict[i][point]

    if index>num:
        ans +=m
    index=num
    
print(ans+index)

### FIXED CODE ###

from collections import defaultdict
from bisect import bisect_right

s,t=input(),input()
m=len(s)

if set(s)&set(t)!=set(t):print(-1);exit()

dict=defaultdict(list)
for i,j in enumerate(s):
    dict[j] +=[i+1]

ans,index=0,0
for i in t:
    point=bisect_right(dict[i],index)
    if point==len(dict[i]):num=dict[i][0]
    else:num=dict[i][point]

    if index>=num:
        ans +=m
    index=num

print(ans+index)
from collections import deque
import sys
sys.setrecursionlimit(3000)
n,m =map(int,input().split())
pas = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    pas[a].append(b)
    pas[b].append(a)

seen = [False for i in range(n)]
que = deque()
def bfn(i,j):
    if seen[i-1]==False:
        seen[i-1]=j
    for x in pas[i]:
        if seen[x-1]!=False:
            continue
        que.append([x,i])
    if que:
        now,pre =que.popleft()
        bfn(now,pre)
    else:
        return

bfn(1,1)

if False in seen:
    print("No")
else:
    print("Yes")
    for i in range(n-1):
        print(seen[i+1])


### FIXED CODE ###

from collections import deque
import sys
sys.setrecursionlimit(1000000)
n,m =map(int,input().split())
pas = [[] for i in range(n+1)]
for i in range(m):
    a,b = map(int,input().split())
    pas[a].append(b)
    pas[b].append(a)

seen = [False for i in range(n)]
que = deque()
def bfn(i,j):
    for x in pas[i]:
        if seen[x-1]!=False:
            continue
        seen[x-1]=i
        que.append([x,i])
    if que:
        now,pre =que.popleft()
        bfn(now,pre)
    else:
        return

bfn(1,1)

if False in seen:
    print("No")
else:
    print("Yes")
    for i in range(n-1):
        print(seen[i+1])
n=int(input())
d=list(map(int,input.split()))
sam=0

for i in range(n):
  for j in range(n-1):
    sam=sam+(d[i]*d[j])

print(sam)

### FIXED CODE ###

n=int(input())
d=list(map(int,input().split()))
sam=0

for i in range(n):
  for j in range(i+1,n): 
    sam=sam+(d[i]*d[j]) 
    

print(sam)
import sys
input = sys.stdin.readline

N, C = [int(x) for x in input().split()]
imos = [0]*(10**6 + 1)

for _ in range(N):
    s, t, c = [int(x) for x in input().split()]
    s *= 10
    t *= 10
    imos[s - 5] += 1
    imos[t + 1] -= 1

from itertools import accumulate

csum = list(accumulate(imos))

print(max(csum))

### FIXED CODE ###

import sys
input = sys.stdin.readline

N, C = [int(x) for x in input().split()]
imos = [0]*(10**6 + 2)
stc = [[] for _ in range(31)]
for _ in range(N):
    tmp = [int(x) for x in input().split()]
    stc[tmp[2]].append([tmp[0], tmp[1]])

for i in range(C + 1):
    if len(stc[i]) == 0:
        continue
    stc[i].sort()
    s, t = stc[i][0][0], stc[i][0][1]
    new_stc_i = []
    flag = 1
    for j in range(1, len(stc[i])):
        flag = 0
        if t == stc[i][j][0]:
            t = stc[i][j][1]
            flag = 1
        else:
            new_stc_i.append([s, t])
            s = stc[i][j][0]
            t = stc[i][j][1]
    if flag:
        new_stc_i.append([s, t])
    stc[i] = new_stc_i

for i in range(C + 1):
    stc_i = stc[i]
    for j in stc_i:
        s, t = j 
        s *= 10
        t *= 10
        imos[max(0, s - 5)] += 1
        imos[t] -= 1

from itertools import accumulate

csum = list(accumulate(imos))

print(max(csum))
import sys
import numpy as np
from numba import njit

def main(N, S, dp):
    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            dp[i,j] = min(j - i, dp[i - 1,j - 1] + 1) if S[i] == S[j] else 0
        ans = max(ans, np.max(dp[i]))
    return ans


if sys.argv[-1] == 'ONLINE_JUDGE':
    import numba
    from numba.pycc import CC
    cc = CC('my_module')
    cc.export('main', 'i8(i8,str,i8[:,:])')(main)
    # b1: bool, i4: int32, i8: int64, double: f8, [:], [:, :]
    cc.compile()
else:
    from my_module import main
    N = int(input())
    S = input()#np.array([ord(_) for _ in input()])
    dp = np.zeros((N + 1, N + 1), dtype=int)
    print(main(N, S, dp))


### FIXED CODE ###

import itertools
N = int(input())
S = input()
dp = [[0] * N for _ in range(N)]
ans = 0
for i, j in itertools.combinations(range(N), 2):
    if S[i] == S[j]:
        dp[i][j] = dp[i - 1][j - 1] + 1
    else:
        dp[i][j] = 0
    ans = max(ans, min(j - i, dp[i][j]))
print(ans)
a = list(map(int,input().split())

if a[0] =< a[1] =< a[2]:
    print('Yes')
else:
    print('No')


### FIXED CODE ###


a = list(map(int, input().split()))

if a[0] < a[1] < a[2]:
    print('Yes')
else:
    print('No')
IN = iter(Input.split('\n')).__next__
def input():
    return IN()

###################################################

x, n = map(int, input().split())
if n == 0:
    print(x)
    exit()
P = set(map(int, input().split()))

d_min = 1000
ans = 1000
for num in range(-1, 102):
    if num in P:
        continue
    
    d = abs(x-num)
    if d < d_min:
        d_min = d
        ans = num

print(ans)

### FIXED CODE ###

x, n = map(int, input().split())
if n == 0:
    print(x)
    exit()
    
P = set(map(int, input().split()))

d_min = 1000
ans = 1000
for num in range(-1, 102):
    if num in P:
        continue
    
    d = abs(x-num)
    if d < d_min:
        d_min = d
        ans = num

print(ans)
import heapq
import numpy as np

n, m, s, t = map(int, input().split())

Yen_cost = np.ones((n, n)) * np.inf
Snuuk_cost = np.ones((n, n)) * np.inf

for _ in range(m):
    u, v, a, b = map(int, input().split())
    u -= 1
    v -= 1
    Yen_cost[u, v] = a
    Yen_cost[v, u] = a
    Snuuk_cost[u, v] = b
    Snuuk_cost[v, u] = b


def Digkstra(Cost_list, start):   
    dist = np.ones(n) * np.inf
    dist[start] = 0
    q = []
    heapq.heappush(q, (0, start))

    while len(q) != 0:
        prov_cost, src = heapq.heappop(q)

        if dist[src] < prov_cost:
            continue

        for dest in range(n):
            cost = Cost_list[src, dest]
            if dist[dest] > dist[src] + cost:
                dist[dest] = dist[src] + cost
                heapq.heappush(q, (dist[dest], dest))
    return dist

Yen_dist = Digkstra(Yen_cost, s-1).astype(int)
Snuuk_dist = Digkstra(Snuuk_cost, t-1).astype(int)

First = 10**15
Money = []
Money.append(int(First - Yen_dist[-1] - Snuuk_dist[-1]))
for year in range(n-2, -1, -1):
    temp = First - Yen_dist[year] - Snuuk_dist[year]
    if temp > Money[-1]:
        Money.append(temp)
    else:
        Money.append(Money[-1])

for i in range(n):
    print(Money[-1-i])



### FIXED CODE ###

import heapq

n, m, s, t = map(int, input().split())

Yen_cost = dict([[i, []] for i in range(n)])
Snuuk_cost = dict([[i, []] for i in range(n)])
for _ in range(m):
    u, v, a, b = map(int, input().split())
    u -= 1
    v -= 1
    Yen_cost[u].append((v, a))
    Yen_cost[v].append((u, a))
    Snuuk_cost[u].append((v, b))
    Snuuk_cost[v].append((u, b))

def Digkstra(Cost_dict, start):   
    dist = [float('inf') for _ in range(n)]
    dist[start] = 0
    q = []
    heapq.heappush(q, (0, start))

    while len(q) != 0:
        prov_cost, src = heapq.heappop(q)

        if dist[src] < prov_cost:
            continue

        for dest, cost in Cost_dict[src]:
            if dist[dest] > dist[src] + cost:
                dist[dest] = dist[src] + cost
                heapq.heappush(q, (dist[dest], dest))
    return dist

Yen_dist = Digkstra(Yen_cost, s-1)
Snuuk_dist = Digkstra(Snuuk_cost, t-1)

First = 10**15
Money = []
Money.append(int(First - Yen_dist[-1] - Snuuk_dist[-1]))
for year in range(n-2, -1, -1):
    temp = First - Yen_dist[year] - Snuuk_dist[year]
    if temp > Money[-1]:
        Money.append(temp)
    else:
        Money.append(Money[-1])

for i in range(n):
    print(Money[-1-i])
def BFS(K,edges,N):
  roots=[ [] for i in range(N)]
  for a,b,c in edges:
    roots[a-1]+=[(b-1,c)]
    roots[b-1]+=[(a-1,c)]
  dist=[-1]*N
  stack=[]
  stack.append(K)
  dist[K]=0
  while stack:
    label=stack.pop(-1)
    for i,c in edges[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        stack+=[i]
  return dist
 
N=int(input())
edges=[]
for i in range(N-1):
  edges+=[list(map(int,input().split()))]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,edges,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])

### FIXED CODE ###

from sys import stdin
input = stdin.readline
from collections import deque
def BFS(K,path,N):
  """リストのリスト道順path,頂点の個数Nが与えられたとき, 頂点Kから各頂点までの距離をlistで返す"""
  dist=[-1]*N
  dist[K]=0
  que=deque()
  que.append(K)
  while que:
    label=que.popleft()
    for i,c in path[label]:
      if dist[i]==-1:
        dist[i]=dist[label]+c
        que+=[i]
  return dist
 
N=int(input())
path=[ [] for i in range(N)]
for i in range(N-1):
  a,b,c=map(int,input().split())
  path[a-1]+=[[b-1,c]]
  path[b-1]+=[[a-1,c]]
Q,K=map(int,input().split())
xy=[list(map(int,input().split())) for i in range(Q)]
distance=BFS(K-1,path,N)
for i in range(Q):
  print(distance[xy[i][0]-1]+distance[xy[i][1]-1])
import numpy as np
import sys
# def input(): return sys.stdin.readline().rstrip()
# input = sys.stdin.readline
input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10 ** 7)

N, K = map(int, input().split())
A = np.array(list(map(int, (input().split()))))
# print(A)
for i in range(K):
    nd = np.zeros((N,N), dtype=bool)
    for j in range(N):
        nd[j,max(j-A[j],0):min(j+A[j]+1,N)] = True
    # print(nd)
    A = np.count_nonzero(nd, axis=0)
    # print(A)

print(*A)

### FIXED CODE ###

import numpy as np
from numba import njit
import sys
# import copy
# def input(): return sys.stdin.readline().rstrip()
# input = sys.stdin.readline
input = sys.stdin.buffer.readline
# sys.setrecursionlimit(10 ** 7)

N, K = map(int, input().split())
# A = np.array(list(map(int, (input().split()))))
A = np.array(input().split(), dtype=np.int64)
# A = list(map(int, (input().split())))
# nd = np.zeros((N,N), dtype=bool)
# print(*A)

# @njit('(i8[::1],)', cache=True)
@njit(cache=True)
def loop(A):
    for i in range(K):
        # cnt = [0]*N
        cnt = np.zeros_like(A)
        for j, x in enumerate(A):
            # nd[j, max(j-A[j],0):min(j+A[j]+1,N)] = True
            l = max(j-x,0)
            r = min(j+x+1,N)
            cnt[l] += 1
            if r<N:
                cnt[r] -= 1
            # for k in range(max(j-A[j],0), min(j+A[j]+1,N)):
            #     cnt[k] += 1
        # print(nd)
        # A = np.count_nonzero(nd, axis=0)
        # print(cnt)
        A = np.cumsum(cnt)
        if A[0] == A[N-1] == N:
            break
        # print(*A)
    return A

A = loop(A)
print(*A)
S = input()
T = input()

count = None

for i in range(3):
    if(S[i] == T[i]):
        count += 1
        
if(count == 0):
    print(0)
elif(count == 1):
    print(1)
elif(count == 2):
    print(2)
else:
    print(3)

### FIXED CODE ###

S = input()
T = input()

count = 0

for i in range(3):
    if(S[i] == T[i]):
        count += 1
        
if(count == 0):
    print(0)
elif(count == 1):
    print(1)
elif(count == 2):
    print(2)
else:
    print(3)
n = int (input())
resilt =0
for i in range(1,n):
    result =result +i
print (result)

### FIXED CODE ###

n = int (input())
result =0
for i in range(1,n+1):
    result =result +i
print (result)
N, K = map(int,input().split())
L = input()
count=0
for i in range(N-1):
  if L[i]==L[i+1]:
    count += 1

print(min(count+2*L, N-1))

### FIXED CODE ###

N, K = map(int,input().split())
L = input()
count=0
for i in range(N-1):
  if L[i]==L[i+1]:
    count += 1

print(min(count+2*K, N-1))
n,m,*a=map(int,open(0).read().split())
b=[-1]*(n+1)
for i in a:
    b[i]=0
if a[0]==1:
    b[2]=1
elif a[0]==2:
    b[1]=1
else:    
    b[1],b[2]=1,2
for i in range(3,n+1):
    if b[i]==-1:
        b[i]=(b[i-1]+b[i-2])%1000000007
print(b[-1])

### FIXED CODE ###

n,m,*a=map(int,open(0).read().split())
if n==1:
    print(1)
    exit()
b=[-1]*(n+1)
a+=[0,0]
for i in a:
    b[i]=0
if a[0]==1 and a[1]==2:
    b[1],b[2]=0,0
elif a[0]==1:
    b[2]=1
elif a[0]==2:
    b[1]=1
else:    
    b[1],b[2]=1,2
for i in range(3,n+1):
    if b[i]==-1:
        b[i]=(b[i-1]+b[i-2])%1000000007
print(b[-1])
import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
 b = X - a
 if 2 * a + 4 * b == Y:
 ans = 'Yes'
 print(ans)

### FIXED CODE ###

import sys

X, Y = map(int, input().split())
ans = 'No'
if X > 100 or Y > 100:
  print(ans)
  sys.exit()
if Y > X*4 or Y < X*2:
  print(ans)
  sys.exit()
if Y % 2 == 1:
  print(ans)
  sys.exit()

for a in range(X + 1):
  b = X - a
  if 2 * a + 4 * b == Y:
    ans = 'Yes'
    print(ans)
mport math
n,m=[int(i) for i in input().split()]
a=[]
b=[]
for i in range(n):
  a0,b0=[int(i) for i in input().split()]
  a.append(a0)
  b.append(b0)
a.sort(reverse=True)
b.sort(reverse=True)
x=0
while m>0:
  if b==[]:
    x+=math.ceil(m/a[0])
    break
  else:
    if b[0]>a[0]:
      m-=b[0]
      del b[0] 
      x+=1
    else:
      x+=math.ceil(m/a[0])
      break
    
print(x)

### FIXED CODE ###

import math
n,m=[int(i) for i in input().split()]
a=[]
b=[]
for i in range(n):
  a0,b0=[int(i) for i in input().split()]
  a.append(a0)
  b.append(b0)
a.sort(reverse=True)
b.sort(reverse=True)
x=0
while m>0:
  if b==[]:
    x+=math.ceil(m/a[0])
    break
  else:
    if b[0]>a[0]:
      m-=b[0]
      del b[0] 
      x+=1
    else:
      x+=math.ceil(m/a[0])
      break
    
print(x)
ABInput = str(input())
 
AB = ABInput.split(" ")
 
A = AB[0]
B = AB[1]
 
TotalCartain = B * 2
 
if TotalCartain > A or TotalCartain == A:
  print (0)
else:
  print (A-TotalCartain)

### FIXED CODE ###

ABInput = str(input())
 
AB = ABInput.split(" ")
 
A = int(AB[0])
B = int(AB[1])
 
TotalCartain = B * 2
 
if TotalCartain > A or TotalCartain == A:
  print (0)
else:
  print (A-TotalCartain)
x = int(input)

print(1 if x == 0 else 0)

### FIXED CODE ###

x = int(input())

print(1 if x == 0 else 0)
def g(a,b):x=max([a,b]);y=min([a,b]);return g(y,x%y) if x%y else y
N,X=map(int,input().split());a=[abs(int(i)-X) for i in input().split()];ans=a[0]
for i in range(1,N):ans=g(ans,y[i])
print(ans)

### FIXED CODE ###

def gcd(a,b):
    x=max([a,b])
    y=min([a,b])
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)
N,X=map(int,input().split())
x=[int(i) for i in input().split()]
y=[abs(x[i]-X) for i in range(N)]
if N==1:
    print(y[0])
    exit()
ans=gcd(y[0],y[1])
for i in range(2,N):
    ans=gcd(ans,y[i])
print(ans)
S = input()
L = len[S]
for i in rnage(L):
    print("x")

### FIXED CODE ###

S = input()
L = len(S)
for i in range(L):
    print("x",end='')
s=raw_input()
s=s.split()
if x<=k*500:
 a="Yes"
else:
 a="No"
print(a)

### FIXED CODE ###

s=raw_input()
s=s.split()
s[0]=int(s[0])
s[1]=int(s[1])
if s[1]<=s[0]*500:
 a="Yes"
else:
 a="No"
print(a)
import numpy as np
N = int(input())
B = input()

B_array = np.array(list(map(int, list(B))))
B_1 = B_array.sum()
mod_list_m1 = []
mod_list = []
mod_list_p1 = []
if B_1 == 1:
    for i in range(N):
        print(1)
else:
    for i in range(N):
        mod_list.append((2**i) % (B_1))
        mod_list_m1.append((2**i) % (B_1-1))
        mod_list_p1.append((2**i) % (B_1+1))
    mod_list = np.array(mod_list)[::-1]
    mod_list_m1 = np.array(mod_list_m1)[::-1]
    mod_list_p1 = np.array(mod_list_p1)[::-1]

    mod_m1 = B_array.dot(mod_list_m1) % (B_1-1)
    mod_p1 = B_array.dot(mod_list_p1) % (B_1+1)
    print(mod_m1)

    def calc_small(n, iter):
        iter += 1
        mod = n % bin(n).count("1")
        if mod == 0:
            return iter
        else:
            return calc_small(mod, iter)

    for i in range(N):
        mod = (mod_m1 - mod_list_m1[i]) % (B_1-1) if B_array[i] == 1 else (mod_p1 + mod_list_p1[i]) % (B_1+1)
        iter = 1
        if mod == 0:
            print(iter)
        else:
            print(calc_small(mod, iter))
    




### FIXED CODE ###

N = int(input())
B = input()

B_1 = B.count("1")
mod_p1 = int(B,2) % (B_1+1)
if B_1 != 1:
    mod_m1 = int(B,2) % (B_1-1)

def calc_small(n, iter):
    iter += 1
    mod = n % bin(n).count("1")

    if mod == 0:
        return iter
    else:
        return calc_small(mod, iter)

for i in range(N):
    if B_1 == 1 and int(B[i]) == 1:
        print(0)
        continue
    mod = (mod_m1 - pow(2,N-i-1,B_1-1)) % (B_1-1) if int(B[i]) == 1 else (mod_p1 + pow(2,N-i-1,B_1+1)) % (B_1+1)
    iter = 1
    if mod == 0:
        print(iter)
    else:
        print(calc_small(mod, iter))
s = input()
k = int(input())
cnt  = 0
ans  = 0
while True:
    if cnt == len(s):
        print("1")
        exit(1)
    if s[cnt] != '1':
        print(s[cnt])
        exit(1)
    cnt += 1

### FIXED CODE ###

s = input()
k = int(input())
ans  = True
for i in range(k):
    if s[i] != '1':
        print(s[i])
        ans = False
        break
if ans:
    print(1)
def main():
    N = int(input())

    ans = 0
    for i in range(len(str(N))):
        if len(str(N)) != i+1:
            if i % 2 == 0:
                ans += 9*(10**i)
        else:
            if i % 2 == 0:
                ans += int(str(N)[1:])+1
    print(ans)


if __name__ == "__main__":
    main()

### FIXED CODE ###

def main():
    N = int(input())

    ans = 0
    if len(str(N)) % 2 == 0:
        for i in range(len(str(N))):
            if i % 2 == 0:
                ans += 9*(10**i)
    else:
        for i in range(len(str(N))+1):
            if i % 2 == 0:
                ans += 9*(10**i)
        ans = ans - (10**len(str(N)) - N) + 1
        
    print(ans)

if __name__ == "__main__":
    main()
s = input()
if s[3:4] == 'ff' and s[5:6] == 'ee'
    print('Yes')
else:
    print('No')

### FIXED CODE ###

s = input()
if s[2]==s[3] and s[4]==s[5]:
    print('Yes')
else:
    print('No')
a=int(input())
for i in range(1,a+1):
    if(i*i)>a:
        j=i-1
        break;
        
print(j*j);

### FIXED CODE ###

import math
n = int(input())
s = int(math.sqrt(n))
print(s**2)
h,w=map(int,input().split());c=0
for i in range(h):
  a=input().split(".")
  c+=len(a)
print("Possible"if h+w-1==ans else"Impossible")

### FIXED CODE ###

h,w=map(int,input().split());c=0
for i in range(h):
  a=input()
  b=[]
  for j in range(w):b.append(a[j])
  c+=b.count("#")
print("Possible"if h+w-1==c else"Impossible")
#greedy方法
import fractions
n=int(input())
lists=[]
for x in range(n):
    x,y=map(int,input().split())
    lists.append([x,y])
lists.append([1,1])
a=lists[0][0]
b=lists[0][1]
k=0
cnt=0
while cnt<n:
    k=max(fractions.ceil(a/lists[cnt+1][0]),fractions.ceil(b/lists[cnt+1][1]))
    a=lists[cnt+1][0]*k
    b=lists[cnt+1][1]*k   
    cnt+=1    
print(a+int(a*(min(lists[n-1][0],lists[n-1][1])/max(lists[n-1][0],lists[n-1][1])) ))

### FIXED CODE ###

n=int(input())
lists=[]
import math
for i in range(n):
    a,t=map(int,input().split())
    lists.append([a,t])
x=1
y=1
for i in range(n):
    j=max((x-1)//lists[i][0]+1,(y-1)//lists[i][1]+1)
    x=lists[i][0]*j
    y=lists[i][1]*j
print(x+y)