Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, open[0])
print(min(a, b) + min(c, d))

Fixed submission:
a, b, c, d = map(int, open(0))
print(min(a, b) + min(c, d))

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
print(min(a, b) + min(c, d))

Fixed submission:
a, b, c, d = map(int, open(0))
print(min(a, b) + min(c, d))
Buggy python submission (verdict: Runtime Error):
a, b, c, x = map(int, [input() fot z in range(4)])
 
ans = 0
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1

print(ans)

Fixed submission:
a, b, c, x = map(int, [input() for z in range(4)])
 
ans = 0
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
a, b, c, x = map(int, [input() fot i in range(4)])

ans = 0

for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)

Fixed submission:
a, b, c, x = map(int, [input() for z in range(4)])
 
ans = 0
 
for i in range(a+1):
  for j in range(b+1):
    for k in range(c+1):
      if i*500 + j*100 + k*50 == x:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())

if (a * b) % 2 == 0:
  print("Odd")
else:
  print("Even")

Fixed submission:
a, b = map(int, input().split())
if (a*b)%2 != 0:
  print("Odd")
else:
  print("Even")
Buggy python submission (verdict: Runtime Error):
S = list(input())
print(S[:3]+"8"+S[4:])

Fixed submission:
S = input()
print(S[:3]+"8"+S[4:])

Buggy python submission (verdict: Runtime Error):
S = input()
S[3]="8"
print(S)

Fixed submission:
S = input()
print(S[:3]+"8"+S[4:])

Buggy python submission (verdict: Runtime Error):
S = input()
S[3]=str("8")
print(S)

Fixed submission:
S = input()
print(S[:3]+"8"+S[4:])
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())
 
total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in X:
    y += int(j)
    
  if a <= y <= b:
    total += i
print(total)

Fixed submission:
n, a, b = map(int, input().split())
 
total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in x:
    y += int(j)
  if a <= y <= b:
    total += i
print(total)

Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())

total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in X:
    y += j
    
  if a <= y <= b:
    total += i

print(total)

Fixed submission:
n, a, b = map(int, input().split())
 
total = 0
for i in range(n+1):
  x = str(i)
  y = 0
  for j in x:
    y += int(j)
  if a <= y <= b:
    total += i
print(total)
Buggy python submission (verdict: Runtime Error):
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
	A = [a/2 for a in A]
    counts += 1
print(counts)

Fixed submission:
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  counts += 1
print(counts)

Buggy python submission (verdict: Runtime Error):
n = input()
 
A = list(map(int, input().split())
 
counts = 0
while all(a%2==0 for a in A):
	A = [a/2 for a in A]
    counts += 1
print(counts)

Fixed submission:
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  counts += 1
print(counts)

Buggy python submission (verdict: Runtime Error):
n = input()

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

counts = 0
while all(a%2==0 for a in A):
	texts = [a/2 for a in A]
    counts += 1
print(counts)

Fixed submission:
n = input()
 
A = list(map(int, input().split()))
 
counts = 0
while all(a%2==0 for a in A):
  A = [a/2 for a in A]
  counts += 1
print(counts)
Buggy python submission (verdict: Runtime Error):
c1, c2, c3 = input().split()
c4, c5, c6 = input().split()

if c1 == c6 and c2 == c5 and c3 == c4:
  print("YES")
else:
  print("NO")

Fixed submission:
a = input()
b = input()
 
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n, a = map(int, input().split())
 
print(n**2 - a)

Fixed submission:
n = int(input())
a = int(input())
 
print(n*n - a)

Buggy python submission (verdict: Runtime Error):
n, a = map(int, input().split())

print(n^2 - a)

Fixed submission:
n = int(input())
a = int(input())
 
print(n*n - a)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())

A = a + b
if A < 10:
  print(A):
else:
  print("error")

Fixed submission:
a, b = map(int, input().split())
if a + b < 10:
  print(a + b)
else:
  print("error")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a + b < 10:
  print(a + b):
else:
  print("error")

Fixed submission:
a, b = map(int, input().split())
if a + b < 10:
  print(a + b)
else:
  print("error")
Buggy python submission (verdict: Runtime Error):
a, b, c = input().split()

a = int(a)
c = int(c)

if b == "+":
  print(a + c)
elif b == "-":
  print(a - b)



Fixed submission:
a, b, c = input().split()
 
a = int(a)
c = int(c)
 
if b == "+":
  print(a + c)
elif b == "-":
  print(a - c)
Buggy python submission (verdict: Runtime Error):
a = input()

if a == "e" or a == "i" or a == "a" or a == "u" or a == "o":
  print("vowel")
else:
  print("consonant)

Fixed submission:
a = input()
 
if a == "e" or a == "i" or a == "a" or a == "u" or a == "o":
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

a = a[0]
b = b[0]
c = c[0]

print(a + b + c)

Fixed submission:
a, b, c = input().split()
 
a = a[0]
b = b[0]
c = c[0]
 
print(a + b + c)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
 
if a == b + c:
  print("Yes")
elif b == a + c:
  print("Yes")
elif c = b + a:
  print("Yes")
else:
  print("No")

Fixed submission:
a, b, c = map(int, input().split())
 
if a == b + c:
  print("Yes")
elif b == a + c:
  print("Yes")
elif c == b + a:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())

if a == b + c:
  print("YES")
elif b == a + c:
  print("YES")
elif c = b + a:
  print("YES")
else:
  print("NO")

Fixed submission:
a, b, c = map(int, input().split())
 
if a == b + c:
  print("Yes")
elif b == a + c:
  print("Yes")
elif c == b + a:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
h = input()

print((a+b)*h/2)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
 
print(int((a+b)*h/2))
Buggy python submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(K*X)


Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(N*X)

Buggy python submission (verdict: Runtime Error):
N, K, X, Y = map(int, input().split())

A = K*X + (N-K)*Y
print(A)

Fixed submission:
N = int(input())
K = int(input())
X = int(input())
Y = int(input())
 
if N > K:
  print(K*X + (N-K)*Y)
else:
  print(N*X)
Buggy python submission (verdict: Runtime Error):
n = input()
j = 0
for i in range(n):
  j = j + i
  
print(j)

Fixed submission:
n = int(input())
j = 0
for i in range(n+1):
  j = j + i
  
print(j)

Buggy python submission (verdict: Runtime Error):
n = input()
j = 0
for i in range(n):
  j += i
  
print(j)

Fixed submission:
n = int(input())
j = 0
for i in range(n+1):
  j = j + i
  
print(j)
Buggy python submission (verdict: Runtime Error):
print("Aa"[isupper(input()[0])])

Fixed submission:
print("aA"[input().isupper()])
Buggy python submission (verdict: Time Limit Exceeded):
d = {"Male" : 1, "Female" : 2, "Vacant" : 0}

def check(l, r, a, b):
	if (a == b):
		return ((r - l + 1) % 2 == 1)
	else:
		return ((r - l + 1) % 2 == 0)

def get(k):
	print(k - 1)
	return d[input()]

def main():
	n = int(input())
	left = get(1)
	if (left == 0): return
	right = get(n)
	if (right == 0): return

	l, r = 1, n
	while (l + 2 < r):
		m = (l + r) // 2
		med = get(m)
		if (med == 0): return
		if (check(l, m, left, med)):
			right, r = med, m
		else:
			left, l = med, m
	get(l + 1)

main()

Fixed submission:
d = {"Male" : 1, "Female" : 2, "Vacant" : 0}

def check(l, r, a, b):
	if (a != b):
		return ((r - l + 1) % 2 == 1)
	else:
		return ((r - l + 1) % 2 == 0)

def get(k):
	print(k - 1)
	return d[input()]

def main():
	n = int(input())
	left = get(1)
	if (left == 0): return
	right = get(n)
	if (right == 0): return

	l, r = 1, n
	while (l + 2 < r):
		m = (l + r) // 2
		med = get(m)
		if (med == 0): return
		if (check(l, m, left, med)):
			right, r = med, m
		else:
			left, l = med, m
	get(l + 1)

main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = sum([sum([s[i] == si for si in s[i+1:]]) for i in range(n)])
print(count)

Fixed submission:
n = int(input())
count = 0
ls = dict([])
for i in range(n):
    si = ''.join(sorted(input()))
    if si in ls.keys():
        count += ls[si]
        ls[si] += 1
    else:
        ls[si] = 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = sum([sum([s[i] == si for si in s[i+1:]]) for i in range(n)])
print(count)

Fixed submission:
n = int(input())
count = 0
ls = dict([])
for i in range(n):
    si = ''.join(sorted(input()))
    if si in ls.keys():
        count += ls[si]
        ls[si] += 1
    else:
        ls[si] = 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n = int(input())
s = np.array([''.join(sorted(input())) for _ in range(n)])
count = 0
for i in range(n):
    count += np.count_nonzero(s[i+1:] == s[i])
print(count)

Fixed submission:
n = int(input())
count = 0
ls = dict([])
for i in range(n):
    si = ''.join(sorted(input()))
    if si in ls.keys():
        count += ls[si]
        ls[si] += 1
    else:
        ls[si] = 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = 0
for i in range(n):
    for si in s[i+1:]:
        if s[i] == si:
            count += 1 
print(count)

Fixed submission:
n = int(input())
count = 0
ls = dict([])
for i in range(n):
    si = ''.join(sorted(input()))
    if si in ls.keys():
        count += ls[si]
        ls[si] += 1
    else:
        ls[si] = 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = [''.join(sorted(input())) for _ in range(n)]
count = 0
for i in range(n):
    for si in s[i+1:]:
        if s[i] == si:
            count += 1 
print(count)

Fixed submission:
n = int(input())
count = 0
ls = dict([])
for i in range(n):
    si = ''.join(sorted(input()))
    if si in ls.keys():
        count += ls[si]
        ls[si] += 1
    else:
        ls[si] = 1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ab = sorted([list(map(int, input().split())) for _ in range(n)])
reward = 0
for i in reversed(range(m)):
    mx = 0
    flag = 0
    for j in range(n):
        if ab[j][0] > m-i: break
        if ab[j][1] > ab[mx][1] or not flag:
            mx = j
            flag = 1
    if ab[mx][1] > 0 and flag:
        reward += ab[mx][1]
        ab[mx][1] = 0
print(reward)

Fixed submission:
n, m = map(int, input().split())
jobs = [[] for _ in range(m+1)]
for i in range(n):
    a, b = map(int, input().split())
    if a > m: continue
    jobs[m-a].append(-b)
import heapq
q = []
heapq.heapify(q)
ans = 0
for i in reversed(range(m)):
    [heapq.heappush(q, job) for job in jobs[i]]
    if q: ans -= heapq.heappop(q)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
ab = sorted([list(map(int, input().split())) for _ in range(n)])
reward = 0
for i in reversed(range(m)):
    mx = 0
    flag = 0
    for j in range(n):
        if ab[j][0] > m-i: break
        if ab[j][1] > ab[mx][1] or not flag:
            mx = j
            flag = 1
    if ab[mx][1] > 0 and flag:
        reward += ab[mx][1]
        ab[mx][1] = 0
print(reward)

Fixed submission:
n, m = map(int, input().split())
jobs = [[] for _ in range(m+1)]
for i in range(n):
    a, b = map(int, input().split())
    if a > m: continue
    jobs[m-a].append(-b)
import heapq
q = []
heapq.heapify(q)
ans = 0
for i in reversed(range(m)):
    [heapq.heappush(q, job) for job in jobs[i]]
    if q: ans -= heapq.heappop(q)
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [map(int, input().split()) for _ in range(n)]
#i件目までのアルバイトでj日目までに得られる最大値
dp = [[0]*(m+1) for _ in range(n+1)]
for i in range(n):
    a, b = ab[i]#a日後に報酬bを得られる
    num = m+1-a
    for j in range(num):
        if j-1 >= 0:
            dp[i+1][j] = max(dp[i][j], dp[i][j-1]+b)
        else:
            dp[i+1][j] = max(dp[i][j], b)
    for j in range(a):
        dp[i+1][j+num] = dp[i+1][j+num-1]

print(max(dp[-1]))

Fixed submission:
n, m = map(int, input().split())
jobs = [[] for _ in range(m+1)]
for i in range(n):
    a, b = map(int, input().split())
    if a > m: continue
    jobs[m-a].append(-b)
import heapq
q = []
heapq.heapify(q)
ans = 0
for i in reversed(range(m)):
    [heapq.heappush(q, job) for job in jobs[i]]
    if q: ans -= heapq.heappop(q)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
m = [1] * len(s)
for i in range(1000):
    nm = m[:]
    for j in range(len(s)):
        nm[j] -= m[j]
        if s[j] == 'R':
            nm[j+1] += m[j]
        elif s[j] == 'L':
            nm[j-1] += m[j]
    m = nm
ans = ''
for mi in m:
    ans += str(mi) + ' ' 
print(ans[:-1])

Fixed submission:
s = input()
m = [1] * len(s)
ns = []
ss = 0
for i in range(len(s)-1):
    if s[i:i+2] == 'LR':
        ns.append(s[ss:i+1])
        ss = i+1
ns.append(s[ss:])
m = []
for nsi in ns:
    l = len(nsi)
    mi = [0] * l
    for j in range(l):
        if nsi[j:j+2] == 'RL':
            r = j
            break
    mi[r] = l // 2
    mi[r+1] = l // 2
    if l % 2 == 1:
        mi[r + r % 2] += 1
    m += mi
ans = ''
for mi in m:
    ans += str(mi) + ' ' 
print(ans[:-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in reversed(range(n)):
    count = 0
    for lsi in ls:
        if lsi >= i and not lsi % i:
            count += 1
    if count % 2 != a[i]:
        ls.append(i+1)
print(len(ls))
print(' '.join(map(str, ls)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ls = [0]*(n+1)
ans = []
for i in reversed(list(range(n))):
    if sum(ls[::i+1][1:]) % 2 != a[i]:
        ls[i+1] = 1
        ans.append(i+1)
print(sum(ls))
if ans: print(' '.join(map(str, ans)))

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ls = []
for i in reversed(range(n)):
    count = 0
    for lsi in ls:
        if lsi >= i and not lsi % i:
            count += 1
    if count % 2 != a[i]:
        ls.append(i+1)
print(len(ls))
print(' '.join(map(str, ls)))

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ls = [0]*(n+1)
ans = []
for i in reversed(list(range(n))):
    if sum(ls[::i+1][1:]) % 2 != a[i]:
        ls[i+1] = 1
        ans.append(i+1)
print(sum(ls))
if ans: print(' '.join(map(str, ans)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    dp[i] = min([dp[j]+abs(h[i]-h[j]) for j in [max(0, i-ki-1) for ki in range(k)]])
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    tmp = max(0, i-k)
    dp[i] = min([dpk+abs(h[i]-hk) for dpk, hk in zip(dp[tmp:i], h[tmp:i])])
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    dp[i] = min([dp[max(0, i-ki-1)]+abs(h[i]-h[max(0, i-ki-1)]) for ki in range(k)])
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    tmp = max(0, i-k)
    dp[i] = min([dpk+abs(h[i]-hk) for dpk, hk in zip(dp[tmp:i], h[tmp:i])])
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
h = np.array(list(map(int, input().split())))
dp = np.zeros(n)
get_d = lambda i, d: d[i] if i >= 0 else 0
for i in list(range(n))[1:]:
    dp[i] = np.min([get_d(i-ki-1, dp)+np.abs(h[i]-get_d(i-ki-1, h)) for ki in range(k)])
print(int(dp[-1]))

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    tmp = max(0, i-k)
    dp[i] = min([dpk+abs(h[i]-hk) for dpk, hk in zip(dp[tmp:i], h[tmp:i])])
print(dp[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
get_d = lambda i, d: d[i] if i >= 0 else 0
for i in list(range(n))[1:]:
    dp[i] = min([get_d(i-ki-1, dp)+abs(h[i]-get_d(i-ki-1, h)) for ki in range(k)])
print(dp[-1])

Fixed submission:
n, k = map(int, input().split())
h = list(map(int, input().split()))
dp = [0]*n
for i in list(range(n))[1:]:
    tmp = max(0, i-k)
    dp[i] = min([dpk+abs(h[i]-hk) for dpk, hk in zip(dp[tmp:i], h[tmp:i])])
print(dp[-1])
Buggy python submission (verdict: Runtime Error):
n, w = map(int, input().split())
import numpy as np
dp = np.zeros((n+1, w+1), np.int64)
for i in list(range(n+1))[1:]:
    wi, vi = map(int, input().split())
    dp[i] = [max(dp[i-1][j], dp[i-1][j-wi]+vi) if j >= wi else dp[i-1][j] for j in range(w+1)]
print(max(dp[-1]))

Fixed submission:
n, w = map(int, input().split())
import numpy as np
dp = np.zeros(w+1, np.int64)
for i in range(n):
    wi, vi = map(int, input().split())
    np.maximum(dp[:-wi]+vi, dp[wi:], out=dp[wi:])
print(max(dp))

Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())
import numpy as np
dp = np.zeros((n+1, w+1), np.int64)
for i in list(range(n+1))[1:]:
    wi, vi = map(int, input().split())
    dp[i] = [max(dp[i-1][j], dp[i-1][j-wi]+vi) if j >= wi else dp[i-1][j] for j in range(w+1)]
print(max(dp[-1]))

Fixed submission:
n, w = map(int, input().split())
import numpy as np
dp = np.zeros(w+1, np.int64)
for i in range(n):
    wi, vi = map(int, input().split())
    np.maximum(dp[:-wi]+vi, dp[wi:], out=dp[wi:])
print(max(dp))

Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())
import numpy as np
dp = np.zeros((n+1, w+1))
for i in list(range(n+1))[1:]:
    wi, vi = map(int, input().split())
    dp[i] = [max(dp[i-1][j], dp[i-1][j-wi]+vi) if j >= wi else dp[i-1][j] for j in range(w+1)]
print(int(max(dp[-1])))

Fixed submission:
n, w = map(int, input().split())
import numpy as np
dp = np.zeros(w+1, np.int64)
for i in range(n):
    wi, vi = map(int, input().split())
    np.maximum(dp[:-wi]+vi, dp[wi:], out=dp[wi:])
print(max(dp))

Buggy python submission (verdict: Time Limit Exceeded):
n, w = map(int, input().split())
import numpy as np
dp = np.zeros((n+1, w+1))
for i in list(range(n+1))[1:]:
    wi, vi = map(int, input().split())
    for j in range(w+1):
        dp[i][j] = max(dp[i-1][j], dp[i-1][j-wi]+vi) if j >= wi else dp[i-1][j]
print(int(max(dp[-1])))

Fixed submission:
n, w = map(int, input().split())
import numpy as np
dp = np.zeros(w+1, np.int64)
for i in range(n):
    wi, vi = map(int, input().split())
    np.maximum(dp[:-wi]+vi, dp[wi:], out=dp[wi:])
print(max(dp))
Buggy python submission (verdict: Runtime Error):
T = input()

if T >= 30:
    print("Yes")
else:
    print("No")

Fixed submission:
T = int(input())
if T >= 30:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

sum_N = 0

while N >= 10:
  sum_N += N % 10
  N = N //10

if (sum_N+N) % 9 == 0:
  print('Yes')
else:
  print('No')
  

Fixed submission:
N = int(input())

if N%9 ==0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
N , D = map(int,input().split)

X=Y=p=count=0

for index in range(N):
  X,Y = map(int,input().split)
  p = sqrt(X**2 + Y**2)
  if p <= D:
    count += 1
    
print(count)

Fixed submission:
import math

N,D=(int(x) for x in input().split())

X=Y=p=count=0

for i in range(N):
  X,Y=(int(x) for x in input().split())
  p =math.sqrt(X**2+Y**2)
  if p <= D:
    count += 1
    
print(count)
Buggy python submission (verdict: Runtime Error):
input_num = int(input())

n_surplus = input_num % 1000

if n_surplus == 0:
  print(n_surplus)
  else:
    print(1000 - n_surplus)
    


Fixed submission:
int_num = int(input())
n_surplus = int_num % 1000

if n_surplus == 0:
    print(0)
else:
    print(1000 - n_surplus)
Buggy python submission (verdict: Runtime Error):
N = int(input())
C =　[0]*4
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  else M == "WA":
    C[1] += 1
  else M == "TLE":
    C[2] += 1
  else M == "RE":
    C[3] += 1
    
print("AC" + " × " + str(C[0]))
print("WA" + " × " + str(C[1]))
print("TLE" + " × " + str(C[2]))
print("RE" + " × " + str(C[3]))
 


Fixed submission:
N = int(input())
C = [0]*4
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  elif M == "WA":
    C[1] += 1
  elif M == "TLE":
    C[2] += 1
  elif M == "RE":
    C[3] += 1
    
print("AC x " + str(C[0]))
print("WA x " + str(C[1]))
print("TLE x " + str(C[2]))
print("RE x " + str(C[3]))

Buggy python submission (verdict: Runtime Error):
N = int(input())
C =　[0]*4
Moji = ["AC","WA","TLE","RE"]
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  else M == "WA":
    C[1] += 1
  else M == "TLE":
    C[2] += 1
  else M == "RE":
    C[3] += 1
    
print(Moji[i] + " × " C[i] for i in range(len(Moji)))



Fixed submission:
N = int(input())
C = [0]*4
for i in range(N):
  M = input()
  if M == "AC":
    C[0] += 1
  elif M == "WA":
    C[1] += 1
  elif M == "TLE":
    C[2] += 1
  elif M == "RE":
    C[3] += 1
    
print("AC x " + str(C[0]))
print("WA x " + str(C[1]))
print("TLE x " + str(C[2]))
print("RE x " + str(C[3]))
Buggy python submission (verdict: Runtime Error):

import sys
import math
cin = sys.stdin.readline
n, x, t = map(int, cin().split())

count = math.ceil(n / x)
print(count * t)


Fixed submission:
import sys
cin = sys.stdin.readline
n = list(cin())
ans = 0

n.pop(-1)
for i in n:
    ans += int(i)
if ans % 9 == 0:
    print('Yes')
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
mport itertools as it


N = int(input())
s = list(map(int, input().split()))
s.sort()
count = 0


c = it.combinations(s, 3)

for i in c:
    if i[0] == i[1] or i[1] == i[2] or i[2] == i[0]:
        continue
    if (i[0] + i[1]) > i[2]:
        count += 1

print(count)

Fixed submission:
import itertools as it


N = int(input()) - 1
s = list(map(int, input().split()))
count = 0

c = it.combinations(s, 3)

for i in c:
    listed = list(i)
    if listed[0] == listed[1] or listed[1] == listed[2] or listed[2] == listed[0]:
        continue
    maximum = max(listed)
    listed.remove(maximum)
    if (listed[0] + listed[1]) > maximum:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
count = 0
print(D)
print(index)
for i in range(N):
    a, b = map(int, input().split())
    if (a**2 + b**2) <= D**2:
        count += 1
print(count)


Fixed submission:
N, D = map(int, input().split())
count = 0
for i in range(N):
    a, b = map(int, input().split())
    if (a**2 + b**2) <= D**2:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if abs(a-b) / (v-w) <= t:
    print('YES')
else:
    print('NO')

Fixed submission:
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())
if (v==w) or (w>v) :
    print('NO')
    exit()

if abs(a-b) / (v-w) <= t:
    print('YES')
else:
    print('NO')