Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
ans = 0
k = int(input())
def GCD(a, b):
  if b == 0:
    return a
  else:
    return GCD(b, a%b)
for i in range(1, k+1):
  for j in range(1, k+1):
    gcd = GCD(i, j)
    for l in range(1, k+1):
      ans += GCD(gcd, l)
print(ans)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
  for j in range(1, k+1):
    GCD = gcd(i, j)
    for l in range(1, k+1):
      ans += gcd(GCD, l)
print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np
x = np.arange(1, K + 1)
nums = np.gcd.outer(np.gcd.outer(x, x), x)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
  for j in range(1, k+1):
    GCD = gcd(i, j)
    for l in range(1, k+1):
      ans += gcd(GCD, l)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from fractions import gcd
from functools import reduce
k = int(input())
def GCD(*numbers):
    return reduce(gcd, numbers)
ans = 0 
for i in range(1, k+1):
  for j in range(1, k+1):
    for l in range(1, k+1):
      ans += GCD(i, j ,l)
print(ans)

Fixed submission:
from math import gcd
ans = 0
k = int(input())
for i in range(1, k+1):
  for j in range(1, k+1):
    GCD = gcd(i, j)
    for l in range(1, k+1):
      ans += gcd(GCD, l)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
if n > k:
  if n%k != 0:
    ans = min(n, abs((n%k) - k))
  else:
    ans = 0
print(ans)

Fixed submission:
n, k = map(int, input().split())
ans = 0
if n%k != 0:
  ans = (min(n, abs((n%k) - k)))
print(ans)

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split())
if n > k:
  if n%k != 0:
    ans = min(n, abs((n%k) - k))
  else:
    ans = 0
print(ans)

Fixed submission:
n, k = map(int, input().split())
ans = 0
if n%k != 0:
  ans = (min(n, abs((n%k) - k)))
print(ans)
Buggy python submission (verdict: Runtime Error):
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[k-1])

Fixed submission:
k = int(input())
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(a[k-1])
Buggy python submission (verdict: Runtime Error):
a = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
ans  = 'No'
for i in range(3):
  for j in range(3):
    for k in b:
      if a[i][j] == k:
        a[i][j] = 0
for i in range(3):
  if a[i][0] + a[i][1] + a[i][2] == 0:
    ans = 'Yes'
  if a[0][i] + a[1][i] + a[2][i] == 0:
    ans = 'Yes'
if A[0][0]+A[1][1]+A[2][2]==0:
  ans = "Yes"
if A[0][2]+A[1][1]+A[2][0]==0:
  ans = "Yes"
print(ans)

Fixed submission:
a = [list(map(int,input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]
ans  = [[False]*3 for _ in range(3)]
result = 'No'
for i in range(3):
  for j in range(3):
    for k in b:
      if a[i][j] == k:
        ans[i][j] = True 
for i in ans:
    if all(i):
      result = 'Yes'
for i in range(3):
  cnt = 0
  for j in range(3):
    if ans[j][i]:
      cnt += 1
  if cnt == 3:
    result = 'Yes'
    break
if ans[0][0] and ans[1][1] and ans[2][2]:
  result = "Yes"
if ans[0][2] and ans[1][1] and ans[2][0]:
  result = "Yes"
print(result)
Buggy python submission (verdict: Runtime Error):
n,r = int(input())
if n>10:
  print(r)
else:
  print(r-(100*(10-n)))

Fixed submission:
n,r = map(int,input().split())
if n>10:
  print(r)
else:
  print(r+100*(10-n))

Buggy python submission (verdict: Runtime Error):
n,r = int(input())
if n>10:
  print(r)
else:
  print(100*(10-n))

Fixed submission:
n,r = map(int,input().split())
if n>10:
  print(r)
else:
  print(r+100*(10-n))
Buggy python submission (verdict: Runtime Error):
n = int(input())
X = list(int(x)for x in input().split())
ams = []
for p in range(min(X),max(X)):
  total = 0
  for x in X:
    total += (x-p)**2
  ans.append(total)
print(min(ans))

Fixed submission:
n = int(input())
X = list(int(x)for x in input().split())
ans = []
for p in range(min(X),max(X)+1):
  total = 0 
  for x in X:
    total += (x-p)**2
  ans.append(total)
print(min(ans))
Buggy python submission (verdict: Runtime Error):
N,K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
for i in range(K):
  H[i] = 0
print(sum(H))

Fixed submission:
N,K = map(int, input().split())
H = list(map(int, input().split()))
H.sort(reverse=True)
print(sum(H[K:]))
Buggy python submission (verdict: Runtime Error):
n,m = map(int, intput().split())
print('Yes' if n==m else 'No')

Fixed submission:
n,m = map(int, input().split())
print('Yes' if n == m else 'No')

Buggy python submission (verdict: Runtime Error):
n,m = map(int, intput().split())
print('Yes' if N==M else 'No')

Fixed submission:
n,m = map(int, input().split())
print('Yes' if n == m else 'No')
Buggy python submission (verdict: Runtime Error):
s, t = map(input().split())
print(s+t)

Fixed submission:
s, t = input().split()
print(t+s)
Buggy python submission (verdict: Runtime Error):
x = int(input())
def prime(n):
  for j in range(2, int(n**(0.5))+1):
    if n%j == 0:
      return False
  return True
for i in range(x, 10**(5) + 1):
  if prime(i):
    ans = i
    break
print(ans)

Fixed submission:
x = int(input())
def prime(x):
  for i in range(2, int(x**0.5)+1):
    if x%i == 0:
      return False
  return True
for i in range(x, 100003 + 1):
  ans = prime(i)
  if ans:
    break
print(i)
Buggy python submission (verdict: Runtime Error):
n= int(input())
s = input()
al='ABCDEFGHIJKLMNOPQRSTUVXXYZ'
print(''.join([al[-len(al)+al.index(i)+n] for i in s]))

Fixed submission:
n= int(input())
s = input()
al='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
print(''.join([al[-len(al)+al.index(i)+n] for i in s]))
Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[k-q]*n
for i in range(q):
    point=int(input())
    a[point-1] += 1
for i in range(len(l)):
    if l[i] > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
s =input()
ans = ["Sunny","Cloudy","Rainy"]
ans_index = (ans.index(s)+1)%3 -1
print(ans[ans_index+1])

Buggy python submission (verdict: Runtime Error):
n,k,q=map(int,input().split())
a=[k-q]*n
for i in range(q):
    point=int(input())
    a[point-1] += 1
for i in range(len(l)):
    if l[i] > 0:
        print("Yes")
    else:
        print("No")

Fixed submission:
s =input()
ans = ["Sunny","Cloudy","Rainy"]
ans_index = (ans.index(s)+1)%3 -1
print(ans[ans_index+1])
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
count = 0
 for i,j in zip(s,t):
  if i==j:
     count += 1
print(count)

Fixed submission:
s = input()
t = input()
count = 0
for i,j in zip(s,t):
  if i==j:
    count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
ans = []
for i in range(0,n-1):
  count = 0
  while h[i] >= h[i+1]:
    count += 1
    if h[i] < h[i+1]:
      break
  ans.append(count)
print(max(ans))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
ans = -1*float('inf')
cnt = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
ans = max(ans, cnt)
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
h = list(map(int, input().split()))
ans = []
for i in range(0,n-1):
  if h[i] < h[i+1]:
    ans.append(count)
    count = 0
  if h[i] >= h[i+1]:
    count+= 1
print(max(ans))

Fixed submission:
n = int(input())
h = list(map(int, input().split()))
ans = -1*float('inf')
cnt = 0
for i in range(n-1):
  if h[i] >= h[i+1]:
    cnt += 1
  else:
    ans = max(ans, cnt)
    cnt = 0
ans = max(ans, cnt)
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
ans = 0
if n <= 2:
  ans = 1%n
else:
  ans = n*(n-1)//2
print(ans)

Fixed submission:
n = int(input())
ans = 0
if n <= 2:
  ans = 1%n
else:
  ans = n*(n-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
n =int(input())
print(len([i for i in range(1, n+1) if int(log10(i)+1) % 2 != 0 and i <= n]))

Fixed submission:
from math import log10
n = int(input())
cnt = 0
for i in range(1,n+1):
  if int(log10(i)+1) % 2 != 0 and i <= n:
    cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d =map(int, input().split())
lcm = (c//math.gcd(c, d))*d
cnt = (b-a+1)
c_cnt = (b//c)-((a-1)//c)
d_cnt = (b//d)-((a-1)//d)
lcm_cnt = (b//lcm)-((a-1)//lcm)
print(cnt+lcm_cnt-c_cnt-d_cnt)

Fixed submission:
import fractions
a, b, c, d =map(int, input().split())
lcm = (c//fractions.gcd(c, d))*d
cnt = (b-a+1)
c_cnt = (b//c) - ((a-1)//c)
d_cnt = (b//d) - ((a-1)//d)
lcm_cnt = (b//lcm) - ((a-1)//lcm)
print(cnt + lcm_cnt - c_cnt - d_cnt)

Buggy python submission (verdict: Runtime Error):
import math
a, b, c, d =map(int, input().split())
lcm = (c//math.gcd(c, d))*d
cnt = (b-a+1)
c_cnt = (b//c) - ((a-1)//c)
d_cnt = (b//d) - ((a-1)//d)
lcm_cnt = (b//lcm) - ((a-1)//lcm)
print(cnt + lcm_cnt - c_cnt - d_cnt)

Fixed submission:
import fractions
a, b, c, d =map(int, input().split())
lcm = (c//fractions.gcd(c, d))*d
cnt = (b-a+1)
c_cnt = (b//c) - ((a-1)//c)
d_cnt = (b//d) - ((a-1)//d)
lcm_cnt = (b//lcm) - ((a-1)//lcm)
print(cnt + lcm_cnt - c_cnt - d_cnt)
Buggy python submission (verdict: Runtime Error):
ans = [int(input()) for _ range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')

Fixed submission:
ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')

Buggy python submission (verdict: Runtime Error):
ans = [int(input()) for _ range(6)]
print(':(' if abs(ans[0]-ans[4]) <= ans[-1] else 'Yay!')

Fixed submission:
ans = [int(input()) for _ in range(6)]
print(':(' if abs(ans[0]-ans[4]) > ans[-1] else 'Yay!')
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int, input().split())
sp =[i for i in range(1, max(a,b)) if a%i == 0 and b%i==0]
print(sp[k-1])

Fixed submission:
a,b,k = map(int, input().split())
sp =[i for i in range(1, max(a,b)+1) if a%i == 0 and b%i==0]
sp.sort(reverse=True)
print(sp[k-1])
Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
print(reduce(gcd, numbers))

Fixed submission:
from fractions import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))

Buggy python submission (verdict: Runtime Error):
from fractions import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def gcd(*numbers):
    return reduce(math.gcd, numbers)
print(gcd(a))

Fixed submission:
from fractions import gcd
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def gcd_list(numbers):
    return reduce(gcd, numbers)
print(gcd_list(a))
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input(.split())))
ind = L.index(max(L))
if sum(L[ind-1:])+sum(L[:ind+1]) < max(L)
    print('Yes')
else:      
    print('No')

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
if max(l) < sum(l) - max(l):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
N = int(input())
L = list(map(int, input(.split())))
if sum(L[:N-1]) < max(L):
    print('Yes')
else:      
    print('No')

Fixed submission:
n = int(input())
l = list(map(int, input().split()))
if max(l) < sum(l) - max(l):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
l = list(map(int , [input() for i in range(n)]))
l_max = max(l)
if (sum(l) - l_max) > 0:
  print('Yes')
else :
  print('No')


Fixed submission:
n = int(input())
l = list(map(int, input().split()))
if max(l) < sum(l) - max(l):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
2 A, B, C = input(), input(), input()
3 ans = 0
4 for i in range(N):
5 ans += len(set([A[i], B[i], C[i]])) - 1
6 print(ans)

Fixed submission:
N = int(input())
A, B, C = input(), input(), input()
ans = 0
for i in range(N):
  ans += len(set([A[i], B[i], C[i]])) - 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, h, w = map(int, input().split())
a_b = [list(map(int, input().split())) for _ range(n)]
cnt = 0
for i in range(n):
  if a_b[i][0] >= h and a_b[i][1] >= w:
    cnt += 1
print(cnt)

Fixed submission:
n, h, w = map(int, input().split())
a_b = [list(map(int, input().split())) for _ in range(n)]
cnt = 0
for i in range(n):
  if a_b[i][0] >= h and a_b[i][1] >= w:
    cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
n = input()
p = [int(input()) for _ in range(n)]
print(p.pop()//2 + sum(p))

Fixed submission:
N = int(input())
P = [int(input()) for _ in range(N)]
P.sort()
print(P[-1]//2 + sum(P[:N-1]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
T,A =map(int, input().split())
H = list(map(int, input().split()))
dif = [A-i for i in [int(T-h*0.006) for h in H]]
print(dif.index(min(dif)+1))


Fixed submission:
n = int(input())
t,a =  map(int, input().split())
h = list(map(int, input().split()))
ave = [abs(a-(t-i*0.006)) for i in h]
print(ave.index(min(ave))+1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input()
b = input()
print('Hello World' if n ==1 else int(a)+int(b))

Fixed submission:
n = int(input())
print('Hello World' if n ==1 else int(input())+int(input()))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def function(m, a):
  count = 0
  for i in a:
    count += m%i
  return count
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
max_num = lcm(*a)-1
print(function(max_num, a))


Fixed submission:
import math
from functools import reduce
n = int(input())
a = list(map(int, input().split()))
def function(m, a):
  count = 0
  for i in a:
    count += m%i
  return count
def lcm_base(x, y):
    return (x * y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
max_num = lcm(*a)-1
print(function(max_num, a))
Buggy python submission (verdict: Runtime Error):
print('Yes' if input()[:3] in [str(i)*3 for i in range(0,10)] or input()[1:] in [str(i)*3 for i in range(0,10)] else 'No')

Fixed submission:
n = input()
ans = [str(i)*3 for i in range(0,10)]
print('Yes' if n[:3] in ans or n[1:] in ans else 'No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [N-2**i for i in range(0,7) if N-2**i > 0]
min_index = a.index(min(a))
print(2**min_index)

Fixed submission:
N = int(input())
a = [N-2**i for i in range(0,7) if N-2**i >= 0]
min_index = a.index(min(a))
print(2**min_index)
Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
cnt = 0
cnt_box = list(range(0,k+1))
for i in range(0,k+1):
  for j in range(0, k+1):
    z = s - i - j
    if z in cnt_box:
      cnt += 1
print(cnt)

Fixed submission:
k,s = map(int, input().split())
cnt = 0
for i in range(0,k+1):
  for j in range(0, k+1):
    z = s - i - j
    if 0<=z<=k:
      cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
k,s = map(int, input().split())
cnt = 0
for i in range(0,k+1):
  for j in range(0, k+1):
    for l in range(0,k+1):
      if i+j+l == s:
        cnt += 1
print(cnt)

Fixed submission:
k,s = map(int, input().split())
cnt = 0
for i in range(0,k+1):
  for j in range(0, k+1):
    z = s - i - j
    if 0<=z<=k:
      cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
abc = list(map(int, input().split()))
print(len(set(abc))

Fixed submission:
a = list(map(int, input().split()))
print(len(set(a)))
Buggy python submission (verdict: Runtime Error):
s=input()
gou=0
if s[0]=="R" and s[1]=="R":
  gou=2
if s[1]=="R" and s[2]=="R":
  gou=2
if s[1]=="R" and s[2]=="R" and s[3]=="R":
  gou=3
print(gou)

Fixed submission:
s=input()
gou=0
if s[0]=="R" or s[1]=="R" or s[2]=="R":
  gou=1
if s[0]=="R" and s[1]=="R":
  gou=2
if s[1]=="R" and s[2]=="R":
  gou=2
if s[1]=="R" and s[2]=="R" and s[0]=="R":
  gou=3
print(gou)
Buggy python submission (verdict: Time Limit Exceeded):
x= int(input())
k = 1
while True:
  if 360/x == k:
    print(k)
    break
  k+=1

Fixed submission:
x= int(input())
k = 1
while True:
  a = x*k
  if a%360==0:
    print(k)
    break
  k+=1

Buggy python submission (verdict: Time Limit Exceeded):
x= int(input())
k = 1
while True:
  if k*x == 360:
    print(k)
    break
  k+=1

Fixed submission:
x= int(input())
k = 1
while True:
  a = x*k
  if a%360==0:
    print(k)
    break
  k+=1
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().sprit())
k = "NO"
for i in range(x+1):
  b=x-i
  if i*4+b*2==y:
    k="YES"
print(k)

Fixed submission:
x,y = map(int,input().split())
k = "No"
for i in range(x+1):
  b=x-i
  if (b*4)+(i*2)==y:
    k="Yes"
print(k)
Buggy python submission (verdict: Runtime Error):
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
	to *= a
    if to > 10**18:
	print("-1")
    exit()
else:
  print(to)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
    to *= a
    if to > (10**18):
        print("-1")
        exit()
print(to)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
	to *= a
if to > 10**18:
	print("-1")
else:
  print(to)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
    to *= a
    if to > (10**18):
        print("-1")
        exit()
print(to)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = list(map(int, input().split()))
to = t[0]
for a in t[1:]:
	to *= a
if to > 10**18:
	print("-1")
else:
  print(to)

Fixed submission:
n = int(input())
t = list(map(int, input().split()))
to = t[0]
if 0 in t:
  print(0)
  exit()
for a in t[1:]:
    to *= a
    if to > (10**18):
        print("-1")
        exit()
print(to)
Buggy python submission (verdict: Time Limit Exceeded):
k,s=map(int,input().split())
cnt=0
for i in range(k+1):
  for j in range(k+1):
    for h in range(k+1):
      if s==i+j+h:
        cnt+=1
print(cnt)

Fixed submission:
k,s=map(int,input().split())
cnt=0
for i in range(k+1):
  for j in range(k+1):
    h = s-i-j
    if 0<=h and h <=k:
      cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]

for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])
ans = 0
for i in range(N+1):
    for j in range(M+1):
        if a[i] + b[j] <= K:
            ans = max(ans, i+j)
print(ans)

Fixed submission:
N,M,K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
a = [0]
b = [0]

for i in range(N):
    a.append(a[i] + A[i])
for j in range(M):
    b.append(b[j] + B[j])
ans = 0
j = M
for i in range(N+1):
    if a[i] > K:
        break
    while a[i] + b[j] > K:
        j -= 1
    ans = max(ans, i+j)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
L, R = [0]*M, [0]*M
A = set(range(N))
for i in range(M):
    L[i], R[i] = map(int, input().split())
    A = A & set(range(L[i]-1, R[i]))
print(len(A))

Fixed submission:
N, M = map(int, input().split())
L, R = [0]*M, [0]*M
A = set(range(N))
lm, rm = 0, N
for i in range(M):
    L[i], R[i] = map(int, input().split())
    lm = max(lm, L[i])
    rm = min(rm, R[i])
if lm <= rm:
    print(rm-lm+1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
W = input()
ans = 0
count = 0
for i in range(len(W)):
  if W[i] == R:
    count += 1
    ans = max(ans,count)
  else:
    count = 0
print(ans)

Fixed submission:
W = input()
ans = 0
count = 0
for i in range(len(W)):
  if W[i] == "R":
    count += 1
    ans = max(ans,count)
  else:
    count = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
X = abs(X)
X_div_D = X//D

p_min = X % D
n_min = abs(p_min - D)

if p_min <= n_min:
  ans_min = p_min
  min_idx = X_div_D
else:
  ans = min = n_min
  min_idx = X_div_D + 1
  
if K <= min_idx:
  print(X - K * D)
else:
  if (K - min_idx) % 2 == 0:
    print(ans_min)
  else:
    print(abs(ans_min - D))

Fixed submission:
X,K,D = map(int,input().split())
X = abs(X)
X_div_D = X//D

ans_min = X % D

if K <= X_div_D:
  print(X - K * D)
else:
  if (K % 2) ^ (X_div_D % 2) == 0:
    print(ans_min)
  else:
    print(abs(ans_min - D))

Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
X = abs(X)
X_div_D = X//D

p_min = X % D
n_min = abs(p_min - D)

if p_min <= n_min:
  ans_min = p_min
  min_idx = X_div_D
  sign_min = 1
else:
  ans = min = n_min
  min_idx = X_div_D + 1
  sign_min = -1
  
if K < min_idx:
  print(X - K * D)
else:
  if (K - min_idx) % 2 == 0:
    print(ans_min)
  else:
    print(abs(ans_min - sign_min * D))

Fixed submission:
X,K,D = map(int,input().split())
X = abs(X)
X_div_D = X//D

ans_min = X % D

if K <= X_div_D:
  print(X - K * D)
else:
  if (K % 2) ^ (X_div_D % 2) == 0:
    print(ans_min)
  else:
    print(abs(ans_min - D))

Buggy python submission (verdict: Runtime Error):
X,K,D = map(int,input().split())
X_div_D = X//D

p_min = X % D
n_min = abs(p_min - D)

if p_min <= n_min:
  ans_min = p_min
  min_idx = X_div_D
  sign_min = 1
else:
  ans = min = n_min
  min_idx = X_div_D + 1
  sign_min = -1
  
if K < min_idx:
  print(X - K * D)
else:
  if (K - min_idx) % 2 == 0:
    print(ans_min)
  else:
    print(abs(ans_min - sign_min * D))

Fixed submission:
X,K,D = map(int,input().split())
X = abs(X)
X_div_D = X//D

ans_min = X % D

if K <= X_div_D:
  print(X - K * D)
else:
  if (K % 2) ^ (X_div_D % 2) == 0:
    print(ans_min)
  else:
    print(abs(ans_min - D))
Buggy python submission (verdict: Runtime Error):
import math
N,D = map(int,input().split())

ans = 0
for i in range(N):
  x,y = map(int,input().split())
  d = math.sprt(x**2 + y**2)
  if d <= D:
    ans += 1
print(ans)

Fixed submission:
import math
N,D = map(int,input().split())
 
ans = 0
for i in range(N):
  x,y = map(int,input().split())
  d = math.sqrt(x**2 + y**2)
  if d <= D:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input()) // 2 * 2 
    A = list(map(int,input().split()))
    ans = 0

    for i in range(0,N+2,2):
        if A[i] % 2 == 1:
            ans += 1
    print(ans)
resolve()

Fixed submission:
def resolve():
    N = (int(input()) + 1) // 2 * 2 
    A = list(map(int,input().split()))
    ans = 0

    for i in range(0,N,2):
        if A[i] % 2 == 1:
            ans += 1
    print(ans)
resolve()
Buggy python submission (verdict: Runtime Error):
a = int(input)
ans = a + a*a + a*a*a
print(ans)

Fixed submission:
a = int(input())
ans = a + a*a + a*a*a
print(ans)