Harryxun/stf_run huggingface dataset:
BLOCK_WIDTH = 4
BLOCK_HEIGHT = 2
field = []
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
w = 0
h = 0
xg = 0
yg = 0

def main():
    global field, w, h, xg, yg
    while True:
        w, h = map(int, input().split())
        if w == 0 and h == 0:
            break
        xs, ys = map(int, input().split())
        xg, yg = map(int, input().split())
        n = int(input())
        field = [[0] * w for _ in range(h)]
        for i in range(n):
            c, d, x, y = map(int, input().split())
            arrangement(c, d, x, y)

        if dfs(field[ys][xs], xs, ys):
            print("OK")
        else:
            print("NG")


def arrangement(c, d, x, y):
    global field
    if d == 0:
        [[draw(x + j, y + i, c) for j in range(BLOCK_WIDTH)] for i in range(BLOCK_HEIGHT)]
    else:
        [[draw(x + j, y + i, c) for j in range(BLOCK_HEIGHT)] for i in range(BLOCK_WIDTH)]


def draw(x, y, c):
    field[y][x] = c


def dfs(c, x, y):
    global field

    if x == xg and y == yg:
        return True
    field[y][x] = -1
    for i in range(4):
        next_x = x + dx[i]
        next_y = y + dy[i]
        if next_x < 0 or next_x >= w or next_y < 0 or next_y >= h:
            continue
        if field[next_y][next_x] == c:
            if dfs(c, next_x, next_y):
                return True

    return False


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys

BLOCK_WIDTH = 4
BLOCK_HEIGHT = 2
field = []
dx = [-1, 0, 1, 0]
dy = [0, 1, 0, -1]
w = 0
h = 0
xg = 0
yg = 0
start_color = 0

def main():
    global field, w, h, c, xg, yg, start_color
    while True:
        w, h = map(int, input().split())
        if w == 0 and h == 0:
            break
        xs, ys = map(int, input().split())
        xg, yg = map(int, input().split())
        xs -= 1
        ys -= 1
        xg -= 1
        yg -= 1
        n = int(input())
        field = [[0] * w for _ in range(h)]
        for i in range(n):
            c, d, x, y = map(int, input().split())
            arrangement(c, d, x - 1, y - 1)

        start_color = field[ys][xs]
        if dfs(xs, ys):
            print("OK")
        else:
            print("NG")


def arrangement(c, d, x, y):
    if d == 0:
        [[draw(x + j, y + i, c) for j in range(BLOCK_WIDTH)] for i in range(BLOCK_HEIGHT)]
    else:
        [[draw(x + j, y + i, c) for j in range(BLOCK_HEIGHT)] for i in range(BLOCK_WIDTH)]


def draw(x, y, c):
    global field
    field[y][x] = c


def dfs(x, y):
    global field

    if x == xg and y == yg:
        return True
    if start_color == 0:
        return False
    field[y][x] = 0
    for i in range(4):
        next_x = x + dx[i]
        next_y = y + dy[i]
        if next_x < 0 or next_x >= w or next_y < 0 or next_y >= h:
            continue
        if field[next_y][next_x] != start_color:
            continue
        if dfs(next_x, next_y):
            return True

    return False


if __name__ == '__main__':
    main()
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7


def debug(*x):
    print(*x, file=sys.stderr)


def solve(S, T):
    buf = []
    for i in range(len(S) - len(T)):
        diff = 0
        for j in range(len(T)):
            if S[i + j] != T[j]:
                diff += 1
        buf.append(diff)
    return min(buf)


def main():
    # parse input
    S = input().strip()
    T = input().strip()
    print(solve(S, T))


# tests
T1 = """
cabacc
abc
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
1
"""

T2 = """
codeforces
atcoder
"""
TEST_T2 = """
>>> as_input(T2)
>>> main()
6
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**6)
INF = 10 ** 9 + 1  # sys.maxsize # float("inf")
MOD = 10 ** 9 + 7


def debug(*x):
    print(*x, file=sys.stderr)


def solve(S, T):
    buf = []
    for i in range(len(S) - len(T) + 1):
        diff = 0
        for j in range(len(T)):
            if S[i + j] != T[j]:
                diff += 1
        buf.append(diff)
    return min(buf)


def main():
    # parse input
    S = input().strip()
    T = input().strip()
    print(solve(S, T))


# tests
T1 = """
cabacc
abc
"""
TEST_T1 = """
>>> as_input(T1)
>>> main()
1
"""

T2 = """
codeforces
atcoder
"""
TEST_T2 = """
>>> as_input(T2)
>>> main()
6
"""

T3 = """
aaa
bbb
"""
TEST_T3 = """
>>> as_input(T3)
>>> main()
3
"""


def _test():
    import doctest
    doctest.testmod()
    g = globals()
    for k in sorted(g):
        if k.startswith("TEST_"):
            doctest.run_docstring_examples(g[k], g, name=k)


def as_input(s):
    "use in test, use given string as input file"
    import io
    f = io.StringIO(s.strip())
    g = globals()
    g["input"] = lambda: bytes(f.readline(), "ascii")
    g["read"] = lambda: bytes(f.read(), "ascii")


input = sys.stdin.buffer.readline
read = sys.stdin.buffer.read

if sys.argv[-1] == "-t":
    print("testing")
    _test()
    sys.exit()

main()
import sys

i = 1
for line in sys.stdin:
    if line != 0:
       print "Case %d: %d" % (i, line)
    else:
       break
    i += 1

### FIXED CODE ###

from __future__ import division, print_function
from sys import stdin

i = 1
for line in stdin:
    x = int(line)
    if x == 0:
       break
    print ("Case %d: %d" % (i, x))
    i += 1
#!usr/bin/env python3

def string_three_numbers_spliter():
    a, b, c = [int(i) for i in input().split()]
    return a, b, c


def count_nums_of_factors_of_c_in_a_and_b(a, b, c):
    count = 0
    # XXX Refactor the algorithm below as it is exhaustive and inefficient.
    for i in range(1, c+1):
        if (c % i == 0):
            if i >= a and i <= b:
                count += 1
    return count


def main():
    a, b, c = string_three_numbers_spliter()
    print(count_nums_of_divisors_of_c_in_a_and_b(a, b, c))


if __name__ == '__main__':
    main()

### FIXED CODE ###

#!usr/bin/env python3

def string_three_numbers_spliter():
    a, b, c = [int(i) for i in input().split()]
    return a, b, c


def count_nums_of_factors_of_c_in_a_and_b(a, b, c):
    count = 0
    # XXX Refactor the algorithm below as it is exhaustive and inefficient.
    for i in range(1, c+1):
        if (c % i == 0):
            if i >= a and i <= b:
                count += 1
    return count


def main():
    a, b, c = string_three_numbers_spliter()
    print(count_nums_of_factors_of_c_in_a_and_b(a, b, c))


if __name__ == '__main__':
    main()
from collections import Counter
n, k = map(int, input().split())
*a, = map(int, input().split())

c = Counter(a)
kv = sorted(c.items(), key=lambda x: x[1], reverse=True)

if n <= k:
    print(0)
else:
    ans = n
    for i in range(k):
        ans -= kv[i][1]
    print(ans)


### FIXED CODE ###

from collections import Counter
n, k = map(int, input().split())
*a, = map(int, input().split())

c = Counter(a)
kv = sorted(c.items(), key=lambda x: x[1], reverse=True)

if n <= k:
    print(0)
else:
    ans = n
    for i in range(k):
        try:
            ans -= kv[i][1]
        except:
            pass
    print(ans)
N=int(input())
S=list(input())
K=int(input())
word=S[K]
for i in range(len(S)):
    if S[i]!=word:
        S[i]='*'
print(''.join(S))

### FIXED CODE ###

N=int(input())
S=list(input())
K=int(input())
word=S[K-1]
for i in range(len(S)):
    if S[i]!=word:
        S[i]='*'
print(''.join(S))
import numpy as np

x = list(map(int,input().split()))
if x[0] > x[1]:
    ans = np.repeat(x[1],x[0])
    for i in ans:
        print(i, end="")
    
elif x[0] < x[1]:
    for i in ans:
        print(i, end="")
    
else:
    ans = np.repeat(x[0],x[1])
    for i in ans:
        print(i, end="")

### FIXED CODE ###

import numpy as np

x = list(map(int,input().split()))
if x[0] > x[1]:
    ans = np.repeat(x[1],x[0])
    for i in ans:
        print(i, end="")
    
elif x[0] < x[1]:
    ans = np.repeat(x[0],x[1])
    for i in ans:
        print(i, end="")
    
else:
    ans = np.repeat(x[0],x[1])
    for i in ans:
        print(i, end="")
n = int(input())
a = list(map(int, input().split()))

a.sort()
color = []
other = 0
for i in a:
    if i < 400 * 1:
        color.append('1')
    elif i < 400 * 2:
        color.append('2')
    elif i < 400 * 3:
        color.append('3')
    elif i < 400 * 4:
        color.append('4')
    elif i < 400 * 5:
        color.append('5')
    elif i < 400 * 6:
        color.append('6')
    elif i < 400 * 7:
        color.append('7')
    elif i < 400 * 8:
        color.append('8')
    else:
        other += 1
max_ans = len(set(color)) + other
min_ans = len(set(color))
if min_ans == 0 and other != 0:
    min_ans = 1
print(min_ans, max_ans)


### FIXED CODE ###

r, g, b = map(str, input().split())
if int(r+g+b)%4 == 0:
    print('YES')
else:
    print('NO')
def erase(x, y):
    c[y][x] = '0'
    for dx, dy in ((1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)):
        nx, ny = x + dx, y + dy
        if 0 <= nx <= w -1 and 0 <= ny <= h - 1:
            if c[ny][nx] == '1':
                erase(nx, ny)

while True:
    w, h = map(int, input().split())
    c = [[i for i in input().split()] for _ in range(h)]
    ans = 0
    for y in range(h):
        for x in range(w):
            if c[y][x] == '1':
                ans += 1
                erase(x, y)
    print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 5)
 
def erase(x, y):
    c[y][x] = '0'
    for dx, dy in ((1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)):
        nx, ny = x + dx, y + dy
        if 0 <= nx < w and 0 <= ny < h and c[ny][nx] == '1':
            erase(nx, ny)
 
while True:
    w, h = map(int, input().split())
    if w == h == 0:
        break
    c = [input().split() for _ in range(h)]
    ans = 0
    for y in range(h):
        for x in range(w):
            if c[y][x] == '1':
                ans += 1
                erase(x, y)
    print(ans)
S=input()

if S[0] == S[1] != S[2] == S[4] or S[0] == S[2] != S[1] == S[3] or S[0] == S[3] != S[1] == S[2]:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

S=input()

if S[0] == S[1] != S[2] == S[3] or S[0] == S[2] != S[1] == S[3] or S[0] == S[3] != S[1] == S[2]:
  print('Yes')
else:
  print('No')
N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)
import sys
sys.setrecursionlimit(100000)

def gcd(a,b):
    if b == 0 : 
        return a  
    return gcd(b,a%b)

def lcm(a,b) :
    return a*b//gcd(a,b)

for i in range(N-1,0,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        p = lcm(para[i],p)
print(p)

### FIXED CODE ###

N=int(input())
para = [int(input()) for i in range(N)]
para.sort(reverse=True)


def gcd(a,b):
    if b == 0 : 
        return a  
    return gcd(b,a%b)

def lcm(a,b) :
    return a*b//gcd(a,b)

for i in range(N-1,-1,-1):
    if i == N-1:
        p = lcm(para[i-1],para[i])
    else :
        a = max(para[i],p)
        b = min(para[i],p)
        p = lcm(a,b)
print(p)
N = int(input())
H = map(int, input().split())

cnt = 0
for i in range(len(H)):
    if (max(H[0:i+1]) == H[i]):
        cnt += 1

print(cnt)


### FIXED CODE ###

N = int(input())
H = list(map(int, input().split()))
ans = 1
for i in range(1,N):
  if H[i]>=max(H[:i]):
    ans += 1
print(ans)
N, M = map(int, input().split())
K = []
S = []
for m in range(M):
    inp = list(map(int, input().split()))
    # K.append(inp[0])
    S.append(inp[1:])

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

X = []


def dfs(A):
    if N == len(A):
        X.append(A.copy())
        return
    for i in [0, 1]:
        A.append(i)
        dfs(A)
        A.pop()


dfs([])


def s(m, x):
    s = 0
    for mm in m:
        s += x[mm - 1]
    return s


count = 0
for x in X:
    flg = True  # 一つでも点灯しないものがあったらFalse
    for m, p in zip(S, P):  # 電球ループ
        su = s(m, x)
        if su % 2 != p:
            flg = False
    if flg:
        count += 1

print(count)


### FIXED CODE ###

N, M = map(int, input().split())
K = []
S = []
for m in range(M):
    inp = list(map(int, input().split()))
    # K.append(inp[0])
    S.append(inp[1:])

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

X = []


def dfs(A):
    if N == len(A):
        X.append(A.copy())
        return
    for i in [0, 1]:
        A.append(i)
        dfs(A)
        A.pop()


dfs([])


def s(m, x):
    s = 0
    for mm in m:
        s += x[mm - 1]
    return s


count = 0
for x in X:
    flg = True  # 一つでも点灯しないものがあったらFalse
    for m, p in zip(S, P):  # 電球ループ
        su = s(m, x)
        if su % 2 != p:
            flg = False
    if flg:
        count += 1

print(count)
n,m = map(int, input().split())
sc=[list(map(int,input().split())) for i in range(m)]
s=[]
c=[]
f=0
ans=[str(0) for i in range(n)]
for i in range(m):
    if sc[i][0]==1 and sc[i][1]==0 and n!=1:
        f=-1
        break
    else:
        if sc[i][0] in s:
            if sc[i][1]!=c[s.index(sc[i][0])]:
                f=-1
                break
        else:
            ans[sc[i][0]-1]=str(sc[i][1])
            s.append(sc[i][0])
            c.append(sc[i][1])
if s[i] in 1 and c[s.index(1)]==0 and n!=1:
    f=-1
    
if f==-1:
    print(-1)
else:
    if n==1:
        print(''.join(ans))
    else:
        if s[i] in 1:
            if c[s.index(1)]==0:
                ans=str(-1)
        if ans[0]==str(0):
            ans[0]==str(1)
        print(''.join(ans))


### FIXED CODE ###

N,M=map(int,input().split())
sc = [list(map(int, input().split())) for _ in range(M)]
a=str(0)*N
A=[a[i] for i in range(len(a))]
x=0
#print(sc)
b=[]
c=[]
for i in range(M):
    if (sc[i][0] == 1) and (sc[i][1]==0) and (N!=1):
        x=-1
        break
    else:
        if (sc[i][0]) in b:#左から何桁目の情報が既にある場合、既に登録されているその桁の値と新たに登録しようとしてるその桁の値が異なるとき弾く
            if sc[i][1]!=int(c[b.index(sc[i][0])]):
                #print(c[b.index(sc[i][0])])
                x=-1
                break
        else:
            A[sc[i][0]-1]=str(sc[i][1])
            b.append(sc[i][0])
            c.append(sc[i][1])
if x==-1:
    print(-1)      
elif b==[] and (N!=1):
    if N==2:
        print(10)
    elif N==3:
        print(100)
elif (1 not in b) and(N!=1):
    A[0]=str(1)
    a="".join(A)
    print(a)
elif  (1 not in b) and (2 not in b) and (N==3):
    A[0]=str(1)
    A[1]=str(0)
    a="".join(A)
    print(a)

else:
    a="".join(A)
    print(a)
N,K = map(int,input().split())
S = []
d = {}
A = list(map(int,input().split()))
ans = 0
sum =0
for i in range(1,N+1):
    sum += A[i-1] % K
    s = (sum - i) % K
    if i > K:
        x = S.pop(0)
        d[x] -= 1
    elif i < K:
        if s == 0:
            ans += 1
    if s not in d:
        d[s] = 0
    ans += d[s]
    d[s] += 1
    S.append(s)
print(ans)

### FIXED CODE ###

S = input()
if S == 'SUN':
    print(7)
elif S == 'MON':
    print(6)
elif S == 'TUE':
    print(5)
elif S == 'WED':
    print(4)
elif S == 'THU':
    print(3)
elif S == 'FRI':
    print(2)
else:
    print(1)
import sys
N, M = map(int,input().split())
A,B=[],[]
for i in range(N):
    array = list(input().split())
    A.append(array)
for j in range(M):
    array = input().split()
    B.append(array)

for i in range(N-M+1):
    for j in range(N-M+1):
        new = [A[k][j:j+M] for k in range(i,i+M)]
        if new == b:
            print('Yes')
            sys.exit()
print('No')

### FIXED CODE ###

import sys
N, M = map(int,input().split())
A = [input() for _ in range(N)]
B = [input() for _ in range(M)]

for i in range(N-M+1):
    for j in range(N-M+1):
        new = [A[k][j:j+M] for k in range(i,i+M)]
        if new == B:
            print('Yes')
            sys.exit()
print('No')
import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = 0
aoki = 0
for i in range(N):
  A[i], B[i] = map(int,input().split())
  C[i].append(i)
  C[i].append(A[i]+B[i])

C = sorted(C, key=lambda x:x[1])

while len(C) > 0:
  tmp_max = C[-1][0]
  takahashi += A[tmp_max]
  A.pop(tmp_max)
  B.pop(tmp_max)
  C.pop(tmp_max)

  if len(C)>0 :
    tmp_max = C[-1][0]
    aoki += B[tmp_max]
    A.pop(tmp_max)
    B.pop(tmp_max)
    C.pop(tmp_max)

print(takahashi-aoki)

### FIXED CODE ###

#%%
import time

import numpy as np

N = int(input())
A = [0] * N
B = [0] * N
C = [[] for _ in range(N) ]
takahashi = []
aoki = []

start = time.time()

for i in range(N):
  A[i], B[i] = map(int,input().split())


D = np.array(A) + np.array(B)
for i in range(N):
  C[i] = [i, D[i]]


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()

C = sorted(C, key=lambda x:x[1])


elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
start = time.time()


if N %2 == 0 :
  for i in range(1,N,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])

elif N %2 != 0 :
  for i in range(1,N-1,2):
    tmp_max = C[-i][0]
    takahashi.append(A[tmp_max])
    tmp_max = C[-i-1][0]
    aoki.append(B[tmp_max])
  tmp_max = C[-N][0]
  takahashi.append(A[tmp_max])

print(sum(takahashi)-sum(aoki))

elapsed_time = time.time() - start
#print ("elapsed_time:{0}".format(elapsed_time) + "[sec]")
A,B,T=map(int,input(),split())
num=(T+0.5)//A
print(num*B)

### FIXED CODE ###

A,B,T=map(int,input().split())
num=(T+0.5)//A
print(int(num*B))
import asyncio
a, b, c, d = map(int, input().split())
loop = asyncio.get_event_loop()
i = c if c < d else d
num = 0
global num
loop_was_not_running = not loop.is_running()
async def y(q):
  if q % c and q % d:
    num += 1
    
def print_hello_world(future):
  if loop_was_not_running:
    loop.stop()

li = [y(o) for o in range(a, b)]
future = asyncio.gather(*li)
asyncio.ensure_future(future)
future.add_done_callback(print_hello_world)
    if loop_was_not_running:
        loop.run_forever()
print(num)


### FIXED CODE ###

s = input()
for k in ["11", "22", "33", "44", "55", "66", "77", "88", "99", "00"]:
  if k in s:
    print('Bad')
    break
else:
  print("Good")
tmp = list(map(int, input().split()))
n = tmp[0]
k = tmp[1]

c = 1
for i in range(1, k+1):
  co = 1
  for j in range(i):
    co *= (n-k+1-j) / (j+1)
  ci = 1
  for j in range(i-1):
    ci *= (k-1-j) / (j+1)

  print (int(co * ci) % (10**9+7))

### FIXED CODE ###

MOD = 1000000007
tmp = list(map(int, input().split()))
n = tmp[0]
k = tmp[1]

co = 1
ci = 1
for i in range(k):
  co *= (n-k+1-i)
  co //= (i+1)
  if i == 0:
    ci *= 1
  else:
    ci *= (k-i)
    ci //= (i)
#  print (str(ci)+' '+str(co)+' '+str(int(co * ci) % MOD))
  print (int(co * ci) % MOD)
S = input()

l = len(S)
for i in range(l):
    if (i + 1) % 2 == 0:
        if S[i] == 'R':
            even = False
        else:
            even = True
    if (i + 1) % 2 == 1:
        if S[i] == 'L':
            odd = False
        else:
            odd = True


if odd == True and even == True:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

S = input()

length = len(S)
evenN = []
oddN = []
for i in range(length):
    if (i + 1) % 2 == 0:
        if S[i] == 'R':
            evenN.append(False)
        else:
            evenN.append(True)
    if (i + 1) % 2 == 1:
        if S[i] == 'L':
            oddN.append(False)
        else:
            oddN.append(True)


if all(oddN) is True and all(evenN) is True:
    print('Yes')
else:
    print('No')
from functools import lru_cache
N = int(input())
h = list(map(int, input().split()))

@lru_cache(None)
def dp(i):
    if i >= N: return 0
    if i + 1 == N - 1: return abs(h[i] - h[i+1])
    if i + 2 == N - 1: return abs(h[i] - h[i+2])
    return min(abs(h[i] - h[i+1]) + dp(i+1), abs(h[i] - h[i+2]) + dp(i+2))

print(dp(0))

### FIXED CODE ###

N = int(input())
h = list(map(int, input().split()))

dp = [0]*N
dp[N-1], dp[N-2] = 0, abs(h[N-1] - h[N-2])
for i in range(N-3,-1,-1):
    dp[i] = min(abs(h[i] - h[i+1]) + dp[i+1], abs(h[i] - h[i+2]) + dp[i+2])
print(dp[0])
N=int(input())
print(N**3

### FIXED CODE ###

N=int(input())
print(N**3)
n = input()
nums = input().split(" ")
rev = float(0)
for i in range(int(n)):
  rev += 1/nums[i]
print(1/rev)

### FIXED CODE ###

n = int(input())
a_n = input().split(" ")
rev = float(0)
for i in range(n):
  rev += 1/int(a_n[i])
print(1/rev)
while 1:
    n=int(input())
    if not n:break    
    t=0
    cnt=0
    for i in range(2,n+1):
        o=n//i
        t+=(i-1) 
        p=n-(i*o-t)
        if o+p//i+1-i<1:break
        if p%i==0:cnt+=1
    print cnt



### FIXED CODE ###

while 1:
    n=int(input())
    if not n:break    
    t=0
    cnt=0
    for i in range(2,n+1):
        o=n//i
        t+=(i-1) 
        p=n-(i*o-t)
        if o+p//i+1-i<1:break
        if p%i==0:cnt+=1
    print(cnt)
h a = map(int, input().split())
if h%a == 0:
  print(int(h/a))
else:
  print(int((h//a) + 1))

### FIXED CODE ###

h, a = map(int, input().split())
if h%a == 0:
  print(int(h/a))
else:
  print(int((h//a) + 1))
N = input()
1<= N(int) <=100

if N(int) % 2 ==0:
  print(float(1/2))

else:
  N(int) % 2 !=0:
  x = (N(int)+1)/2
  print(float(x/N(int)))

### FIXED CODE ###

N = input()
1 <= int(N) <= 100

if int(N) % 2 == 0:
  print(float(1/2))

else:
  x = (int(N)+1)/2
  print(float(x/int(N)))
N = int(input())
A = list(map(int,input().split()))

if 0 in A:
  print(0)
else:
  prod = 1
  for i in A:
    prod *= i
    if prod>10**18:
      print(-1)
      break
  print(prod)

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b[:-3]+b[-2:])
print(int(a*b//100))
h = input()

def myfunc(hp):
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) + int(myfunc(hp/2)) + 1


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)


### FIXED CODE ###

h = input()

def myfunc(hp: 'int') -> 'int':
    if(hp == 1):
        return 1
    elif(hp > 1):
        return int(myfunc(hp/2)) * 2 + 1
    return hp


if __name__ == '__main__':
    ans = myfunc(int(h))
    print(ans)
n, w = map(int, input().split())
wv = [list(map(int, input().split())) for _ in range(n)]

dp = [[0] * (w + 1) for _ in range(n + 1)]
for i in range(n):
  for j in range(w + 1):
    if j + wv[i][0] <= w:
      dp[i + 1][j + wv[i][0]] = max(dp[i + 1][j + wv[i][0]], dp[i][j] + wv[i][1])
    dp[i + 1][j] = max(dp[i][j], dp[i + 1][j])
print(max(dp[-1]))
      

### FIXED CODE ###

N, W = [int(i) for i in input().split()]
WV = [[int(i) for i in input().split()] for j in range(N)]

import numpy as np
max_value = np.sum(np.array(WV), axis=0)[1]

# dp[v]: 価値vを達成するのに必要な重さの最小値
dp = np.full(max_value + 1, W + 1, dtype='int64')

dp[0] = 0
for w, v in WV:
    # 価値i(0 <= i <= max_value - v)のときの重さの最小値に対し
    # 次の荷物を入れて、価値i+vのときの重さの最小値を更新
    np.minimum(dp[:-v] + w, dp[v:], out=dp[v:])
print(np.max(np.where(dp <= W)))