Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
def main():
	A,B,C,D = map(int, input().split())
	while True:
		C - B
		if C <= 0:
			print("Yes")
		A - D
		if A <= 0:
			print("No")
			sys.exit()
main()


Fixed submission:
S,W = map(int, input().split())

if W >= S:
	print("unsafe")

elif W < S:
	print("safe")
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int,input().split()))
a = int(input())
def getNearestValue(h, a):
	idx = np.abs(np.asarray(h) - a).argmin()
	return h[idx]
print(getNearestValue(h, a))


Fixed submission:
n = int(input())
mylist = list(map(int,input().split()))
mylist = sorted(mylist, key=abs)
x = mylist[0] - mylist[-1]
print(abs(x))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reversed = True)
Alice_hand = a[::2]
Bob_hand = a[1::2]
ans = sum(Alice_hand) - sum(Bob_hand)
print(ans)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse = True)
Alice_hand = a[::2]
Bob_hand = a[1::2]
ans = sum(Alice_hand) - sum(Bob_hand)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

def main():
    N = int(input())
    A = list(map(int,input().split()))

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                break
        t += 1

main()


Fixed submission:
import sys

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    t = 0
    while True:
        for i in range(N):
            if A[i] % 2 == 0:
                A[i] //= 2
            else:
                print(t)
                sys.exit()
        t += 1

main()
Buggy python submission (verdict: Runtime Error):
n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if x % kakuketanowa == 0:
	print("Yes")
else:
	print("No")


Fixed submission:
n  = int(input())
kakuketanowa = sum(map(int, list(str(n))))
if n % kakuketanowa == 0:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
s = list(int(input()))
print(s[1::2])


Fixed submission:
s = input()
print(s[::2])

Buggy python submission (verdict: Runtime Error):
s = list(map(int,input().split()))
print(s[1::2])


Fixed submission:
s = input()
print(s[::2])
Buggy python submission (verdict: Runtime Error):
 n = int(input())
    t = 1
    while True:
        if t * 2 > n:
		break
	t *= 2
    print(t)



Fixed submission:
n = int(input())
t = 1
while True:
	if t * 2 > n:
		break
	t *= 2
print(t)

Buggy python submission (verdict: Runtime Error):
import sys
def main():
    n = int(input())
    t = 1
    while True:
        if t * 2 > n:
		break
	t *= 2
    print(t)
main()


Fixed submission:
n = int(input())
t = 1
while True:
	if t * 2 > n:
		break
	t *= 2
print(t)
Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input().split())
if (100 * r + 10 * g + b) % 4 = 0:
	print("YES")
else:
	print("NO")


Fixed submission:
r, g, b = map(int, input().split())
if (100 * r + 10 * g + b) % 4 == 0:
	print("YES")
else:
	print("NO")

Buggy python submission (verdict: Runtime Error):
r, g, b = map(int, input.split())
if 100 * r + 10 * g + b % 4 = 0:
	print("Yes")
else:
	print("No")


Fixed submission:
r, g, b = map(int, input().split())
if (100 * r + 10 * g + b) % 4 == 0:
	print("YES")
else:
	print("NO")
Buggy python submission (verdict: Runtime Error):
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K
        count += 1
print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
count = 0
for x in range(k+1):
  for y in range(k+1):
    z = s - x - y
    if 0 <= z and z <= k
        count += 1
print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
x <= k
y <= k
z <= k
count = 0
for e in range(s+1):
  for f in range(s+1):
    for g in range(s+1):
      if e + f + g == s:
        count =count+1
print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K:
        count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
k, s = map(int, input().split())
x <= k
y <= k
z <= k
count = 0
for x in range(s+1):
  for y in range(s+1):
    for z in range(s+1):
      if x + y + z == s:
        count =count+1
print(count)


Fixed submission:
K, S = map(int, input().split())
count = 0
for X in range(K+1):
  for Y in range(K+1):
    Z = S - X - Y
    if 0 <= Z and Z <= K:
        count += 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
mod = 2019
s = input()
n = len(s)
w = 0
d = [0] * mod
p = 1
for i in reversed(range(n)):
	w += int(s[i]) * p
	p *= 10
	w %= mod
	d[w] += 1
d[0] += 1
o = 0
for x in d:
	o += x * (x - 1) // 2
print(o)


Fixed submission:
mod = 2019
s = input()
n = len(s)
w = 0
d = [0] * mod
p = 1
for i in reversed(range(n)):
	w += int(s[i]) * p
	p *= 10
	p %= mod
	w %= mod
	d[w] += 1
d[0] += 1
o = 0
for x in d:
	o += x * (x - 1) // 2
print(o)

Buggy python submission (verdict: Time Limit Exceeded):
mod = 2019
s = input()
n = len(s)
w = 0
d = {}
p = 1
for i in reversed(range(n)):
	w += int(s[i]) * p
	p *= 10
	w %= mod
	if w in d:
		d[w] += 1
	else:
		d[w] = 1
if 0 in d:
	d[0] += 1
else:
	d[0] = 1
o = 0
for x in d:
	o += d[x] * (d[x] - 1) // 2
print(o)


Fixed submission:
mod = 2019
s = input()
n = len(s)
w = 0
d = [0] * mod
p = 1
for i in reversed(range(n)):
	w += int(s[i]) * p
	p *= 10
	p %= mod
	w %= mod
	d[w] += 1
d[0] += 1
o = 0
for x in d:
	o += x * (x - 1) // 2
print(o)
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
ans = 0
found = False
for i in range(N + 1):
    for j in range(0, N - i + 1):
        k = N - i - j
        is_sum = i * 10_000 + j * 5_000 + k * 1_000 == Y
        if is_sum:
            print(i, j, k)
            found = True
            break
    if found:
        break
        # for k in range(N):
        #     if i * 10_000 + j * 5_000 + k * 1_000 == Y and i + j + k == N:
        #         print(i, j, k)
        #         found = True
if not found:
    print("-1 -1 -1")


Fixed submission:
N, Y = map(int, input().split())
ans = 0
found = False

Y //= 1000

T = 0
for i in range(Y // 10 + 1):
    for j in range((Y - i * 10) // 5 + 1):
        T += 1
        x = Y - i * 10 - j * 5
        if x < 0:
            break
        if i + j + x == N:
            print(i, j, x)
            found = True
            break
    if found:
        break
if not found:
    print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())
ans = 0
found = False
for i in range(N):
    for j in range(N):
        k = N - i - j
        is_sum = i * 10_000 + j * 5_000 + k * 1_000 == Y
        if is_sum:
            print(i, j, k)
            found = True
            break
    if found:
        break
        # for k in range(N):
        #     if i * 10_000 + j * 5_000 + k * 1_000 == Y and i + j + k == N:
        #         print(i, j, k)
        #         found = True
if not found:
    print("-1 -1 -1")


Fixed submission:
N, Y = map(int, input().split())
ans = 0
found = False

Y //= 1000

T = 0
for i in range(Y // 10 + 1):
    for j in range((Y - i * 10) // 5 + 1):
        T += 1
        x = Y - i * 10 - j * 5
        if x < 0:
            break
        if i + j + x == N:
            print(i, j, x)
            found = True
            break
    if found:
        break
if not found:
    print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
elif a == 1 and b == 1 and x == 1:
  answer = 0
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Fixed submission:
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
elif (a**2 * b) == x:
  answer = 0
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Buggy python submission (verdict: Runtime Error):
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Fixed submission:
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
elif (a**2 * b) == x:
  answer = 0
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Buggy python submission (verdict: Runtime Error):
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)

Fixed submission:
import math

a, b, x = map(int,input().split())

answer = 0

if (x / a**2) <= (b/2):
  n = (2*x) / (a*b)
  answer = math.degrees(math.atan(b/n))
elif (a**2 * b) == x:
  answer = 0
else:
  n = ((2*x) / a**2) - b
  answer = 90 - math.degrees(math.atan(a / (b-n) ))

print(answer)
Buggy python submission (verdict: Runtime Error):
S = "".join(list(map(str,input().split())))
if S.count("5") == 2 and S.count("7") == 1:
  print("YES")
else:
  print("NO)

Fixed submission:
S = "".join(list(map(str,input().split())))
if S.count("5") == 2 and S.count("7") == 1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
import math
math.pi
R=int(input())
print(R*2*pi)

Fixed submission:
import math
R=int(input())
print(R*2*math.pi)
Buggy python submission (verdict: Runtime Error):
S = str（input())

ans = 'Good'

for i in range(3):
  if S[i] == S[i+1]:
    ans = 'Bad'
    break
    
    print(ans)

Fixed submission:
s = input()
if s[0]==s[1] or s[1]==s[2] or s[2]==s[3]:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('test_in_3')#
    
    N = f_i.readline().rstrip()
    N = N[::-1] + '0'
    
    INF = 10 ** 32
    
    import numpy as np
    dp = np.full((len(N), 2), INF)
    dp[0][0] = 0
    
    for i, x in enumerate(int(n) for n in N[:-1]):
        ni = i + 1
        dp[ni][0] = min(dp[i] + x)
        dp[ni][1] = min(dp[i][0] + 11 - x, dp[i][1] + 9 - x)
    
    ans = min(dp[-1])
    
    print(ans)

solve()

Fixed submission:
def solve():
    N = input()
    
    INF = 10 ** 32
    
    dp = [[INF, INF] for i in range(len(N) + 1)]
    dp[0][0] = 0
    
    for i, x in enumerate(int(n) for n in N[::-1]):
        ni = i + 1
        dp[ni][0] = min(dp[i][0] + x, dp[i][1] + x)
        dp[ni][1] = min(dp[i][0] + 11 - x, dp[i][1] + 9 - x)
    
    ans = min(dp[-1])
    
    print(ans)

solve()
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
f_i = stdin

H, N = map(int, f_i.readline().split())

dp = [10 ** 8] * (H + 10 ** 4)
dp[0] = 0

for i in range(N):
    A, B = map(int, f_i.readline().split())
    for j, t in enumerate(zip(dp, dp[A:H+A]), start=A):
        dp_i, dp_j = t
        if dp_i + B < dp_j:
            dp[j] = dp_i + B

print(min(dp[H:]))

Fixed submission:
def solve():
    from sys import stdin
    f_i = stdin
    
    H, N = map(int, f_i.readline().split())
    
    dp = [10 ** 8] * (H + 10 ** 4)
    dp[0] = 0
    
    for i in range(N):
        A, B = map(int, f_i.readline().split())
        for j, t in enumerate(zip(dp, dp[A:H+A]), start=A):
            dp_i, dp_j = t
            if dp_i + B < dp_j:
                dp[j] = dp_i + B
    
    print(min(dp[H:]))

solve()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
f_i = stdin

H, N = map(int, f_i.readline().split())

dp = [10 ** 8] * (H + 10 ** 4)
dp[0] = 0

for i in range(N):
    A, B = map(int, f_i.readline().split())
    for i, t in enumerate(zip(dp, dp[A:H+A]), start=A):
        dp_i, dp_j = t
        dp[i] = min(dp_i + B, dp_j)

print(min(dp[H:]))

Fixed submission:
def solve():
    from sys import stdin
    f_i = stdin
    
    H, N = map(int, f_i.readline().split())
    
    dp = [10 ** 8] * (H + 10 ** 4)
    dp[0] = 0
    
    for i in range(N):
        A, B = map(int, f_i.readline().split())
        for j, t in enumerate(zip(dp, dp[A:H+A]), start=A):
            dp_i, dp_j = t
            if dp_i + B < dp_j:
                dp[j] = dp_i + B
    
    print(min(dp[H:]))

solve()
Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
f_i = stdin

N, M = map(int, f_i.readline().split())
A = list(map(int, f_i.readline().split()))

A.sort()

from bisect import bisect_left

def shake_count(power):
    return N ** 2 - sum(bisect_left(A, power - left_hand) for left_hand in A)

lower = A[0] * 2 - 1
upper = A[-1] * 2 + 1
while lower + 1 < upper:
    mid = (lower + upper) // 2
    if shake_count(mid) >= M:
        lower = mid
    else:
        upper = mid

ans = 0
for left_hand in A:
    idx = bisect_left(A, upper - left_hand)
    ans += sum(A[idx:]) + left_hand * (N - idx)

ans += lower * (M - shake_count(upper))

print(ans)

Fixed submission:
from sys import stdin
f_i = stdin

N, M = map(int, f_i.readline().split())
A = list(map(int, f_i.readline().split()))

A.sort()

from bisect import bisect_left

def shake_count(power):
    return N ** 2 - sum(bisect_left(A, power - left_hand) for left_hand in A)

lower = A[0] * 2 - 1
upper = A[-1] * 2 + 1
while lower + 1 < upper:
    mid = (lower + upper) // 2
    if shake_count(mid) >= M:
        lower = mid
    else:
        upper = mid

X = tuple(bisect_left(A, upper - left_hand) for left_hand in A)

from itertools import accumulate
acc = tuple(accumulate([0] + A))

s = acc[-1]
ans = sum(s - acc[x] for x in X) + sum(a * (N - x) for a, x in zip(A, X))

rest_shake_count = M - (N ** 2 - sum(X))
ans += lower * rest_shake_count

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

dp1 = [set() for i in range(4)]
dp2 = [set() for i in range(4)]
dp1[0].add('')
for i, S_i in enumerate(S):
    for j, dp1_j in enumerate(dp1):
        for s in dp1_j:
            dp2[j].add(s)
            if j <= 2:
                dp2[j + 1].add(s + S_i)
    dp1 = dp2
    dp2 = [set() for i in range(4)]

print(len(dp1[-1]))

Fixed submission:
N = int(input())
S = input()

cnt = 0
for i in range(1000):
    n = '{:03d}'.format(i)
    i = 0
    for d in n:
        try:
            i = S.index(d, i) + 1
        except ValueError:
            break
    else:
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = input()

dp = [[dict() for i in range(4)] for i in range(N + 1)]
dp[0][0][''] = True
for i in range(N):
    for j in range(4):
        for k, v in dp[i][j].items():
            dp[i+1][j][k] = True
            if j <= 2:
                dp[i+1][j+1][k+S[i]] = True

print(len(dp[-1][-1]))

Fixed submission:
N = int(input())
S = input()

cnt = 0
for i in range(1000):
    n = '{:03d}'.format(i)
    i = 0
    for d in n:
        try:
            i = S.index(d, i) + 1
        except ValueError:
            break
    else:
        cnt += 1

print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
def solve():
    from itertools import combinations
    
    N = int(input())
    S = input()
    
    passcode = set((''.join(t) for t in combinations(S, 3)))
    print(len(passcode))

solve()

Fixed submission:
N = int(input())
S = input()

cnt = 0
for i in range(1000):
    n = '{:03d}'.format(i)
    i = 0
    for d in n:
        try:
            i = S.index(d, i) + 1
        except ValueError:
            break
    else:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
def get_dist(p1, p2):
    x1, y1 = p1
    x2, y2 = p2
    return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5

def solve():
    from itertools import combinations
    from math import factorial
    from sys import stdin
    #f_i = stdin
    f_i = open('145_C_s3')#
    
    N = int(f_i.readline())
    points = tuple(tuple(map(int, f_i.readline().split())) for i in range(N))
    s = sum(get_dist(p1, p2) for p1, p2 in combinations(points, 2))
    print(s * 2 / N)

solve()

Fixed submission:
def get_dist(p1, p2):
    x1, y1 = p1
    x2, y2 = p2
    return ((x1 - x2) ** 2 + (y1 - y2) ** 2) ** 0.5

def solve():
    from itertools import combinations
    from math import factorial
    from sys import stdin
    f_i = stdin
    
    N = int(f_i.readline())
    points = tuple(tuple(map(int, f_i.readline().split())) for i in range(N))
    s = sum(get_dist(p1, p2) for p1, p2 in combinations(points, 2))
    print(s * 2 / N)

solve()
Buggy python submission (verdict: Time Limit Exceeded):
mod = 10 ** 9 + 7

fact = [1]
fact_inv = [1]
for i in range(10 ** 6):
    new_fact = fact[-1] * (i + 1) % mod
    fact.append(new_fact)
    fact_inv.append(pow(new_fact, mod - 2, mod))

def mod_comb_k(n, k, mod):
    return fact[n] * fact_inv[k] % mod * fact_inv[n-k] % mod

def solve():
    X, Y = map(int, input().split())
    if (2 * X - Y) % 3 == 0:
        s = (2 * Y - X) // 3
        t = (2 * X - Y) // 3
        ans = mod_comb_k(s + t, s, mod)
        print(ans)
    else:
        print(0)

solve()

Fixed submission:
def mod_comb(n, k, p):
    if k > n - k:
        k = n - k
    
    numerator = 1
    denominator = 1
    for i, j in zip(range(n - k + 1, n + 1), range(1, k + 1)):
        numerator = (numerator * i) % p
        denominator = (denominator * j) % p
    
    return (numerator * pow(denominator, p - 2, p)) % p

def solve():
    mod = 10 ** 9 + 7
    X, Y = map(int, input().split())
    s = 2 * Y - X
    t = 2 * X - Y
    if s >= 0 and s % 3 == 0 and t >= 0 and t % 3 == 0:
        s //= 3
        t //= 3
        print(mod_comb(s + t, s, mod))
    else:
        print(0)

solve()
Buggy python submission (verdict: Runtime Error):
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('ABC_145_E_in_s4')#
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        dp_i = dp[i]
        dp_pre = dp[i-1]
        for j, t in enumerate(zip(dp_pre[A_i:], dp_pre), start=A_i):
            x, y = t
            if x < y + B_i:
                dp_i[j] = y + B_i
            else:
                dp_i[j] = x
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    ans = max(ans, dp[-1][-1])
    print(ans)

solve()

Fixed submission:
def solve():
    from sys import stdin
    f_i = stdin
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        dp_i = dp[i]
        dp_pre = dp[i-1]
        dp_i[:A_i] = dp_pre[:A_i]
        for j, t in enumerate(zip(dp_pre[A_i:], dp_pre), start=A_i):
            x, y = t
            if x < y + B_i:
                dp_i[j] = y + B_i
            else:
                dp_i[j] = x
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    print(ans)

solve()

Buggy python submission (verdict: Runtime Error):
def solve():
    from sys import stdin
    #f_i = stdin
    f_i = open('ABC_145_E_in_s3')#
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        for j in range(A_i, T):
            dp[i][j] = max(dp[i-1][j], dp[i-1][j-A_i] + B_i)
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    print(ans)

solve()

Fixed submission:
def solve():
    from sys import stdin
    f_i = stdin
    
    N, T = map(int, f_i.readline().split())
    AB = [tuple(map(int, f_i.readline().split())) for i in range(N)]
    AB.sort()
    
    dp = [[0] * T for i in range(N + 1)]
    
    for i, AB_i in enumerate(AB, start=1):
        A_i, B_i = AB_i
        dp_i = dp[i]
        dp_pre = dp[i-1]
        dp_i[:A_i] = dp_pre[:A_i]
        for j, t in enumerate(zip(dp_pre[A_i:], dp_pre), start=A_i):
            x, y = t
            if x < y + B_i:
                dp_i[j] = y + B_i
            else:
                dp_i[j] = x
    
    ans = max(dp[k][-1] + AB[k][1] for k in range(N))
    print(ans)

solve()
Buggy python submission (verdict: Runtime Error):
H, A = int(input().split())
H = int(H)
A = int(A)
cnt=1
while H-A>0:
	H=H-A
    cnt=cnt+1
print(cnt)

Fixed submission:
a,b = input().split()
##print(type(a))
a = int (a)
b = int(b)
cnt = 1 
while a - b > 0:
    a=a-b
    cnt = cnt + 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
a, b = input().split()
print((a+b-1)//b)

Fixed submission:
a,b = input().split()
##print(type(a))
a = int (a)
b = int(b)
cnt = 1 
while a - b > 0:
    a=a-b
    cnt = cnt + 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
import re

l = sys.stdin.readline()
l = l.split(' ')
l = [int(str) for str in l]

h = l[0]
w = l[1]

out = 0
for i in range(0,w):
 if( i % 2 == 0):
  if( h % 2 == 1 ):
    out += h/2 + 1 
  else:
    out += h/2
 else:
  out += h/2

print(out)
sys.stdout.flush()


Fixed submission:
import sys
import re

l = sys.stdin.readline()
l = l.split(' ')
l = [int(str) for str in l]

h = l[0]
w = l[1]

if ( h == 1):
  print("1")
  exit(0)
if ( w == 1):
  print("1")
  exit(0)

out = 0
if( w % 2 == 0):
  if( h % 2 == 0):
    out = h*w/2
  else:
    out = h*w/2
else:
  if( h % 2 == 0):
    out = h*w/2
  else:
    out = h*(w-1)/2+(h+1)/2
  

print(out)
sys.stdout.flush()
Buggy python submission (verdict: Runtime Error):
import sys
import re

l = sys.stdin.readline()
l = int(l)
out = []
def x(stri,l,depth):
  str = 'abcdefghij'
  for i in range(0,l-depth+1):
    cdepth = depth
    cstri = stri
    cstri += str[i] 
    cdepth -= 1
    if( cdepth == 0):
	out.append(cstri)
    else:
	x(cstri,l,cdepth)


stri = 'a'
if( l == 1):
 print stri
 exit(0)
x(stri,l,l-1)

ret = {}
count = 0
for i in out:
  prev = '0'
  moji = ""
  for j in i:
    if( prev == j ):
      moji += "E"
    else:
      if( prev > j ):
        moji += "U"
      else:
        moji += "D"
    prev = j
  ret[count] = moji
  count += 1
 
count = 0
kekka = {}
for i in out:
  if( ret[count] not in kekka.values()):
    print i
  kekka[count] = ret[count]
  count += 1


sys.stdout.flush()


Fixed submission:
import sys
import re

l = sys.stdin.readline()
l = int(l)
out = []
def x(stri,l,depth):
  str = 'abcdefghij'
  use = 0
  for i in range(0,l-depth+1):
    if( use == 1):
      break
    cdepth = depth
    cstri = stri
    if ( str[i] not in cstri):
      use = 1
    cstri += str[i] 
    cdepth -= 1
    if( cdepth == 0):
	out.append(cstri)
    else:
	x(cstri,l,cdepth)


stri = 'a'
if( l == 1):
 print stri
 exit(0)
x(stri,l,l-1)

count = 0
for i in out:
  print i


sys.stdout.flush()