Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)


Fixed submission:
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
lastR = -1
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
from bisect import bisect_right as br

n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
"""for i in range(n):
	if c[i] != cFixed[i]:
		j = br(c,"R", lo = lastR + 1)-1
		#print(j,i,c[j],c[i],cFixed[i])
		c[i] = c[j]
		c[j] = "W"
		ans += 1


print(ans)"""

for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)


Fixed submission:
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
lastR = -1
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_right as br

n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
ans = 0
for i in range(n):
	if c[i] != cFixed[i]:
		j = br(c,"R", lo = i+1)-1
		while cFixed[j] == c[j]:
			j = br(c, "R", lo = j+1)-1
		c[i] = c[j]
		c[j] = "W"
		ans += 1


print(ans)


Fixed submission:
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
lastR = -1
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
ans = 0
for i in range(n):
	if c[i] != cFixed[i]:
		for j in range(i+1 , n):
			if c[j] == "R" and c[j] != cFixed[j]:
				c[i] = "R"
				c[j] = "W"
				ans += 1


print(ans)


Fixed submission:
n = int(input())
c = list(input())
cFixed = [x for x in c]
cFixed.sort()
lastR = -1
for i in range(n):
	if cFixed[i] == "R":
		lastR = i
ans = 0
for i in range(lastR+1):
	if c[i] == "W":
		ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
c= list(input()) 
if c.count('R') == N:
	print(0)
	exit()
div=0
addcnt = 0
if N %2 == 1:
	div =1
	Q = c[int(N/2)]
	# print(Q)
	if Q == 'W':
		addcnt +=1
		# print('QQQ!')
clist_L = c[:int(N/2)]
clist_R = c[int(N/2)+div:]
Lcnt = clist_L.count('W')
Rcnt = clist_R.count('R')
if Lcnt - Rcnt <=0:
	print(Rcnt-addcnt)
else:
	print(Lcnt-Rcnt+addcnt)

Fixed submission:
s = int(input())


if s >= 30:
	print('Yes')
else:
	print('No')
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n = int(input())
  a = list(map(int,input().split()))
  q = int(input())
  for _ in range(q):
    b, c = map(int, input().split())
    for i in range(0,n):
      if(a[i]==b):
        a[i]=c
    print(sum(a))
main()

Fixed submission:
import collections
def main():
  n = int(input())
  a = list(map(int,input().split()))
  ans=sum(a)
  counter = collections.Counter(a)
  q = int(input())
  for _ in range(q):
    b, c = map(int, input().split())
    num=counter[b]
    counter[b]=0
    counter[c]+=num
    ans+=(c-b)*num
    print(ans)
main()
Buggy python submission (verdict: Runtime Error):
def main():
  a,b = list(map(int,input().split()))
    print(a*b)
main()

Fixed submission:
def main():
  a,b = list(map(int,input().split()))
  print(a*b)
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n=int(input())
  a = list(map(int,input().split()))
  ans=a[0]
  for i in range(1,n):
    ans*=a[i]
  if ans >1000000000000000000:
    ans=-1
  print(ans)
main()

Fixed submission:
def main():
  n=int(input())
  a = list(map(int,input().split()))
  ans=a[0]
  if 0 in a:
    ans=0
  else:
    for i in range(1,n):
      ans*=a[i]
      if ans >1000000000000000000:
        ans=-1
        break
  print(ans)
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n,a,b = list(map(int,input().split()))
  blue=""
  red=""
  for i in range(0,a):
    blue+='b'
  for i in range(0,b):
    red+='r'
  ans=""
  while n>len(ans):
    ans+=blue
    ans+=red
  print(ans[:n].count('b'))
main()

Fixed submission:
def main():
  n,a,b = list(map(int,input().split()))
  ans=0
  count=int(n/(a+b))
  ans+=count*a
  amari=n-count*(a+b)
  if amari <= a:
    ans+=amari
  else:
    ans+=a
  print(ans)
main()

Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n,a,b = list(map(int,input().split()))
  ans=""
  while n>len(ans):
    for i in range(0,a):
      ans+='b'
    for i in range(0,b):
      ans+='r'
  print(ans[:n].count('b'))
main()

Fixed submission:
def main():
  n,a,b = list(map(int,input().split()))
  ans=0
  count=int(n/(a+b))
  ans+=count*a
  amari=n-count*(a+b)
  if amari <= a:
    ans+=amari
  else:
    ans+=a
  print(ans)
main()
Buggy python submission (verdict: Runtime Error):
def main():
  s=input()
  flg=0
  if s.count(s[0])!=2:
    flg=1
  s=s.replace(s[0],'')
  if s.count(s[0])!=2:
    flg=1
  if flg==1:
    print('No')
  else:
    print('Yes')  
main()

Fixed submission:
def main():
  s=input()
  flg=0
  if s.count(s[0])!=2:
    flg=1
  s=s.replace(s[0],'')
  if len(s)>0 and s.count(s[0])!=2:
    flg=1
  if flg==1:
    print('No')
  else:
    print('Yes')  
main()
Buggy python submission (verdict: Runtime Error):
import math
def main():
  x = int(input())
  sum=0
  if x==0 or x==1:
    sum=x
  else:
    for i in range(2,int(math.sqrt(x))+1):
      j=2
      while True:
         if pow(i,j)<=x:
          if pow(i,j)>sum:
            sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()


Fixed submission:
import math
def main():
  x = int(input())
  sum=0
  if x==0 or x==1:
    sum=x
  else:
    for i in range(2,int(math.sqrt(x))+1):
      j=2
      while True:
        if pow(i,j) <= x:
          if pow(i,j) > sum:
            sum=pow(i,j)
        else:
          break
        j+=1
  print(sum)
main()
Buggy python submission (verdict: Time Limit Exceeded):
import math
def main():
  a,b,k = list(map(int,input().split()))
  for i in range(a,b+1):
    if (i < a+k) or(b-k+1 <= i):
      print(i)
  
main()


Fixed submission:
def main():
  a,b,k = list(map(int,input().split()))
  minlist=[]
  maxlist=[]
  ans=[]
  for i in range(0,k):
    if b-i>=a:
      minlist.append(a+i)
    if b-i>=a+k:
      maxlist.insert(0,b-i)
  ans=minlist+maxlist
  set(ans)
  for i in range(0,len(ans)):
    print(ans[i])
main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  n = int(input())
  a = [int(input()) for i in range(n)]
  check_id=1
  check_list=[]
  while True:
    if check_id in check_list:
      print(-1)
      break
    if check_id==2:
      print(len(check_list))
      break      
    check_list.append(check_id)
    check_id=a[check_id-1]  
      
main()

Fixed submission:
def main():
  n = int(input())
  a = [int(input()) for i in range(n)]
  check_id=1
  for i in range(1,n+1):
    check_id=a[check_id-1]
    if check_id==2:
      print(i)
      break
  if check_id!=2:
      print(-1)
main()
Buggy python submission (verdict: Runtime Error):
def main():
  num = list(map(int,input().split()))
  n=num[0]
  m=num[1]
  a = [input() for i in range(n)]
  b = [input() for i in range(m)]

  flg=0
  
  for i in range(0 , n):
    while a[i].find(b[0])!=-1:
      ##print("while",a[i])
      start=a[i].find(b[0])
      for j in range(1 , m):
        ##print("i=",i)
        ##print("j=",j)
        ##print("a[i+j]=",a[i+j])
        if a[i+j][start:start+m]!=b[j]:
          break
        if j==m-1:
          flg=1
      if flg==1:
        break
      a[i]=a[i][a[i].find(b[0])+1:]
    if flg==1:
        break
        
  if flg==1:
    print("Yes")
  else:
    print("No")

main()

Fixed submission:
def main():
  num = list(map(int,input().split()))
  n=num[0]
  m=num[1]
  a = [input() for i in range(n)]
  b = [input() for i in range(m)]

  flg=0
  
  for i in range(0 , n):
    if m==1 and a[i].find(b[0])!=-1:
      flg=1
      break
    while n-i >= m and a[i].find(b[0])!=-1:
      start=a[i].find(b[0])
      for j in range(1 , m):
        if a[i+j][start:start+m]!=b[j]:
          break
        if j==m-1:
          flg=1
      if flg==1:
        break
      a[i]=a[i][a[i].find(b[0])+1:]
    if flg==1:
        break
        
  if flg==1:
    print("Yes")
  else:
    print("No")

main()
Buggy python submission (verdict: Runtime Error):
x=int(input())
ans=0
if 30=<x:
    ans='Yes'
else:
    ans='No'
print(ans)

Fixed submission:
x=int(input())
ans=0
if 30<=x:
    ans='Yes'
else:
    ans='No'
print(ans)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')

Fixed submission:
a=list(map(int,input().split()))
count=1
for x in a:
  if x!=0:
    count+=1
  else:
    break
print(count)

Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')

Fixed submission:
a=list(map(int,input().split()))
count=1
for x in a:
  if x!=0:
    count+=1
  else:
    break
print(count)

Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
if y%2==0 and 2*x<=y and y<=4*x:
    print('Yes')
else:
    print('No')

Fixed submission:
a=list(map(int,input().split()))
count=1
for x in a:
  if x!=0:
    count+=1
  else:
    break
print(count)
Buggy python submission (verdict: Runtime Error):
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
    if x>10**18:
      print(-1)
      break
	else:
      print(x)

Fixed submission:
# coding: utf-8

n = int(input())
numlist = list(map(int, input().split()))
ans = 1;

if 0 in numlist:
    ans = 0
else:
    for i in numlist:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
m=list(map(int,input().split()))
x=1
if 0 in m:
  print(0)
else:
  for y in m:
    x*=y
  if x>10**18:
    print(-1)
  else:
    print(x)



Fixed submission:
# coding: utf-8

n = int(input())
numlist = list(map(int, input().split()))
ans = 1;

if 0 in numlist:
    ans = 0
else:
    for i in numlist:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

print(ans)

Buggy python submission (verdict: Runtime Error):
x=1
n=int(input())
a=map(int,input().split())
m=list(a)
for x in m:
  if x==0:
    print(0)
  else:
    x*=x
if x<=10**18 and x!=0:
  print(x)
elif x==0:
  break
else:
  print(-1)



Fixed submission:
# coding: utf-8

n = int(input())
numlist = list(map(int, input().split()))
ans = 1;

if 0 in numlist:
    ans = 0
else:
    for i in numlist:
        ans *= i
        if ans > 10**18:
            ans = -1
            break

print(ans)
Buggy python submission (verdict: Runtime Error):
N=input()
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('hon')


Fixed submission:
N=int(input())
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('hon')

Buggy python submission (verdict: Runtime Error):
N=input()
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('bon')


Fixed submission:
N=int(input())
if N%10==3:
    print('bon')
elif N%10==0 or  N%10==1 or  N%10==6 or  N%10==8:
    print('pon')
else:
    print('hon')
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
A=list(map(int,input().split()))
s=sorted(A,reverse=True)[m-1]
t=sum(A)//(4*m)+1
if s>=t:
    ans='Yes'
else:
    ans='No'
print(ans)

Fixed submission:
X,Y,Z=input().split()
N=[X,Y,Z]
print(N[2],N[0],N[1])
Buggy python submission (verdict: Runtime Error):
S=input()
list(S)
if S[0]==S[1]==s[2]:
  print('No')
else:
  print('Yes')

Fixed submission:
S=input()
list(S)
if S[0]==S[1] and S[1]==S[2]:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
h,a=map(int,input().split())
if h%a!=0:
  n=int(h/a)+1
  print(n)
else:
  n-=1
  print(n)

Fixed submission:
h,a=map(int,input().split())
if h%a!=0:
  n=int(h/a)+1
  print(n)
else:
  n=int(h/a)
  print(n)
Buggy python submission (verdict: Runtime Error):
n , m = map(int,input().split())
 
g = [[] for i in range(n)]
 
dp = [-1] *n
for _ in range(m):
  v1 , v2 = map(int,input().split())
  v1 -=1; v2 -=1
  g[v1].append(v2)
def dfs(i):
  if dp[i]!=-1:
    return dp[i]
  temp = 0
  for nv in g[i]:
    temp = max(temp, dfs(nv)+1)
  dp[i]=temp
  return temp
res = 0  
for i in range(n):
  res = max(res, dfs(i))
  
print(res)

Fixed submission:
import sys

sys.setrecursionlimit(10**9)

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

g = [[] for i in range(n)]

dp = [-1] *n
for _ in range(m):
  v1 , v2 = map(int,input().split())
  v1 -=1; v2 -=1
  g[v1].append(v2)
  
# finding longest path for vertice i
def dfs(i):
  if dp[i]!=-1:
    return dp[i]
  temp = 0
  for nv in g[i]:
    temp = max(temp, dfs(nv)+1)
  
  dp[i]=temp
  return temp
  
# finding overall longest path  
res = 0  
for i in range(n):
  res = max(res, dfs(i))
  
print(res)
Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0 
  print("Yes")
else:
  print("No")


Fixed submission:
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
x, y = map(int, input().split())
if x >= 2*x and y <= 4*y and y % 2 ==0 or y % 4 ==0:
  print(Yes)
else:
  print(No)

Fixed submission:
x, y = map(int, input().split())
if y >= 2*x and y <= 4*x and y % 2 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
k = int(input())
s = input()

if len(s) <= k:
  print(s)
else:
  print(s[:k] + ...)

Fixed submission:
k = int(input())
s = input()

if len(s) <= k:
  print(s)
else:
  print(s[:k] + "...")
Buggy python submission (verdict: Runtime Error):
X, Y, Z = [int(input()) for a in range(3)]
print(Z, X, Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X, Y, Z = [int(a) for b in input() .split()]
print(Z, X, Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())
print(Z, X, Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())

print(Z, X, Y)


Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X, Y, Z = input()
print(Z, X, Y)


Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X,Y,Z = input()
print(Z,X,Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

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

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)

Buggy python submission (verdict: Runtime Error):
X = int(input())
Y = int(input())
Z = int(input())

print(Z,X,Y)

Fixed submission:
X, Y, Z = map(int, input().split())
print(Z, X, Y)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0
        	ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		ans *= A[i]
		if ans > 10 ** 18:
			ans = -1
			continue

print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		ans *= A[i]

if ans > 10 ** 18:
	print(-1)
else:
	print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
        break
	else:
		ans *= A[i]

if ans > 10 ** 18:
	print(-1)
else:
	print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
	else:
		ans *= A[i]

if ans > 10 ** 18:
	print(-1)
else:
	print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
  ans *= A[i]
if ans > 10 ** 18:
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
  ans *= A[i]
if ans > 1000000000000000000:
  print(-1)
else:
  print(ans)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
ans = 1
for i in range (0, N):
	if A[i] == 0:
		ans = 0
		break
	else:
		if ans > 0:
			ans *= A[i]
		if ans > 10 ** 18:
			ans = -1

print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
import math
s=int(math.sqrt(n))
for i in range(1,n+1):
    count = 0
    for x in range(1,s):
        for y in range(1,s):
            for z in range(1,s):
                if x*x+y*y+z*z+x*y+y*z+z*x == i:
                        count += 1
    print(count)

Fixed submission:
L,R,D=map(int,input().split())
startno = L
while startno % D != 0:
    startno += 1 
lista=list(range(startno,R+1,D))
#print(lista)
print(len(lista))
Buggy python submission (verdict: Runtime Error):
N, D = input().split()

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D*D:
    counter += 1

print(counter)

Fixed submission:
N, D = map(int, input().split())

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D*D:
    counter += 1

print(counter)

Buggy python submission (verdict: Runtime Error):
N, D = input().split()

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D:
    counter += 1

print(counter)

Fixed submission:
N, D = map(int, input().split())

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D*D:
    counter += 1

print(counter)

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

N, D = input().split()

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D:
    counter += 1

print(counter)

Fixed submission:
N, D = map(int, input().split())

x = [0] * N
y = [0] * N

for i in range(N):
  x[i], y[i] = map(int, input().split())
  
counter = 0

for i in range(N):
  dist = x[i] * x[i] + y[i] * y[i]
  if dist <= D*D:
    counter += 1

print(counter)
Buggy python submission (verdict: Runtime Error):
init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = [int(input()) for i in range(N)]
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else
  	sum = sum + ele
print(sum)

Fixed submission:
init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = list(map(int, input().split()))
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else:
  	sum = sum + ele
print(sum)

Buggy python submission (verdict: Runtime Error):
init = input().split()
N = int(init[0])
K = int(init[1])

prices = [int(input()) for i in range(N)]
prices.sort()

sum = 0
for i, ele in enumerate(prices):
  if i == K:
    break
  else
  	sum = sum + ele
print(sum)

Fixed submission:
init = input().split()
N = int(init[0])
K = int(init[1])
 
prices = list(map(int, input().split()))
prices.sort()
 
sum = 0
for i, ele in enumerate(prices):
  if i >= K:
    break
  else:
  	sum = sum + ele
print(sum)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.reaedline

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

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

Fixed submission:
def main():
    x = int(input())
 
    if x >= 30:
        print("Yes")
    else:
        print("No")
main()
Buggy python submission (verdict: Runtime Error):
import sys
input - sys.stdin.readline
def main():
    K = int(input())
    
    if K%2==0:
        print(-1)
        return
    
    if K % 7:
        L = 9*K
    else:
        L = 9*K//7
    a = 1
    for i in range(1,K+10):
        a = (a * 10) % L
        if a == 1:
            print(i)
            return
    print(-1)
main()

Fixed submission:
import sys
input=sys.stdin.readline


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

    if k % 2 == 0:
        print(-1)
        return

    rest = [7 % k]

    for i in range(k):
        rest.append(rest[-1] * 10 % k)

    tmp = 0
    for i in range(k):
        if (tmp + rest[i]) % k == 0:
            print(i + 1)
            return
        else:
            tmp = (tmp + rest[i]) % k
    else:
        print(-1)
main()
Buggy python submission (verdict: Runtime Error):
input = open("input.in").readline

def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    
    l,r = 0, max(A)
    while l < r-1:
        mid = l + (r-l)//2
        cnt = 0
        for a in A:
            cnt+= a//mid
            
        if cnt <= K:
            r = mid
        else:
            l = mid
    print(r)
    
main()

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    N,K = map(int, input().split())
    A = list(map(int, input().split()))
    
    l,r = 0, max(A)
    while l < r-1:
        mid = (l+r)//2
        cnt = 0
        for a in A:
            if a % mid:
                cnt+= a//mid
            else:
                cnt += a//mid - 1
            
        if cnt <= K:
            r = mid
        else:
            l = mid
    print(r)
    
main()