Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    YesNo(int(N:=input()[:3])%111==0 or int(N[1:])%111==0)

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N=input()
    YesNo(int(N[:3])%111==0 or int(N[1:])%111==0)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,M,K=map(int,input().split())
    A=list(range(0,N*M+1,N))
    s=set()
    for i in range(N+1):
        for j in range(M+1):
            if A[i]+(M-i*2)*j==K:
                YesNo(1)
                exit()
    YesNo(0)


if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    N,M,K=map(int,input().split())
    A=list(range(0,N*M+1,N))
    s=set()
    for i in range(M+1):
        for j in range(N+1):
            if A[i]+(M-i*2)*j==K:
                YesNo(1)
                exit()
    YesNo(0)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
w_m=(f*100/(100+e))//100*100
s_m=f*e//(100+e)
answ=float('inf')
anss=0
for i in range(w_m//(a*100)+1):
    for j in range((w_m-i*a*100)//(b*100)+1):
        w=(i*a+j*b)*100
        if w!=0:
            for k in range(s_m//c+1):
                for l in range((s_m-k*c)//d+1):
                    s=k*c+l*d
                    if (anss*(s+w)<s*(anss+answ)) and (s*(100+e)<=e*(s+w)):
                        answ=w
                        anss=s
print(answ+anss,anss)


Fixed submission:
a,b,c,d,e,f=map(int,input().split())
w_m=int((f*100/(100+e)))//100*100
s_m=f*e//(100+e)
answ=100*a
anss=0
for i in range(w_m//(a*100)+1):
    for j in range((w_m-i*a*100)//(b*100)+1):
        w=(i*a+j*b)*100
        if i==0 and j==0:
            w=min(100*a,100*b)
            s_m=f-w
        for k in range(s_m//c+1):
            for l in range((s_m-k*c)//d+1):
                s=k*c+l*d
                if (anss*(s+w)<s*(anss+answ)) and (s*(100+e)<=e*(s+w)):
                    answ=w
                    anss=s
print(answ+anss,anss)

Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,f=map(int,input().split())
w_m=f//(100+e)*100
s_m=f//(100+e)*e
w=w_m//(100*a)*(100*a)
s=s_m//c*c
wn=w_m//(100*b)
sc=s_m//c
sd=s_m//d
noudo=0
answ=0
anss=0
for i in range(wn+1):
    for j in range(sc+1):
        for k in range((s_m-j*c)//d+1):
            s=j*c+k*d
            if (noudo<s/(s+w)) and (s/(s+w)<=e/(100+e)):
                noudo=s/(s+w)
                answ=w
                anss=s
    w+=b*100
    while w<=w_m:
        w-=a*100

print(answ+anss,anss)

Fixed submission:
a,b,c,d,e,f=map(int,input().split())
w_m=int((f*100/(100+e)))//100*100
s_m=f*e//(100+e)
answ=100*a
anss=0
for i in range(w_m//(a*100)+1):
    for j in range((w_m-i*a*100)//(b*100)+1):
        w=(i*a+j*b)*100
        if i==0 and j==0:
            w=min(100*a,100*b)
            s_m=f-w
        for k in range(s_m//c+1):
            for l in range((s_m-k*c)//d+1):
                s=k*c+l*d
                if (anss*(s+w)<s*(anss+answ)) and (s*(100+e)<=e*(s+w)):
                    answ=w
                    anss=s
print(answ+anss,anss)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    H,W,N=map(int,input().split())
    a,b=[0]*N,[0]*N
    for i in range(N):
        a[i],b[i]=map(int1,input().split())
    unique_a=list(set(a))
    unique_b=list(set(b))
    unique_a.sort()
    unique_b.sort()
    d_a,d_b={},{}
    tmp_a=0
    if unique_a:
        d_a[unique_a[0]]=tmp_a
        for i in range(len(unique_a)-1):
            tmp_a+=min(unique_a[i+1]-unique_a[i],3)
            d_a[unique_a[i+1]]=tmp_a
    tmp_b=0
    if unique_b:
        d_b[unique_b[0]]=tmp_b
        for i in range(len(unique_b)-1):
            tmp_b+=min(unique_b[i+1]-unique_b[i],3)
            d_b[unique_b[i+1]]=tmp_b
    c=[[0]*(tmp_b+1) for _ in range(tmp_a+1)]
    for i in range(N):
        c[d_a[a[i]]][d_b[b[i]]]+=1
    s=[[0]*(tmp_b+2) for _ in range(tmp_a+2)]
    for i in range(tmp_a+1):
        for j in range(tmp_b+1):
            s[i+1][j+1]=s[i][j+1]+s[i+1][j]-s[i][j]+c[i][j]
    ans=[0]*10
    for i in range(tmp_a-1):
        for j in range(tmp_b-1):
            ans[s[i+3][j+3]-s[i][j+3]-s[i+3][j]+s[i][j]]+=1
    ans[0]=(H-2)*(W-2)-sum(ans[1:])
    for row in ans:
        print(row)
    
    

if __name__ == '__main__':
    main()


Fixed submission:
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    H,W,N=map(int,input().split())
    s=set()
    for i in range(N):
        s.add(tuple(map(int1,input().split())))
    ans=[0]*10
    used=set()
    for y,x in s:
        for dy in range(-1,2):
            for dx in range(-1,2):
                if 0>y+dy-1 or y+dy+1>=H or 0>x+dx-1 or x+dx+1>=W or (y+dy,x+dx) in used:
                    continue
                tmp=0
                used.add((y+dy,x+dx))
                for ddy in range(-1,2):
                    for ddx in range(-1,2):
                        if (y+dy+ddy,x+dx+ddx) in s:
                            tmp+=1
                ans[tmp]+=1
    ans[0]=(H-2)*(W-2)-sum(ans[1:])
    for row in ans:
        print(row)
    
    

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
items = set()
for _ range(n):
  s = input()
  items.add(s)
print(len(items))

Fixed submission:
n = int(input())
items = set()
for _ in range(n):
  s = input()
  items.add(s)
print(len(items))
Buggy python submission (verdict: Runtime Error):
a,b=int(input().split(' '))

ans = 0
if a>=2:
    ans += a*(a-1)//2
if b>=2:
    ans += b*(b-1)//2
print(ans)    


Fixed submission:
a,b=map(int, input().split(' '))
 
ans = 0
if a>=2:
    ans += a*(a-1)//2
if b>=2:
    ans += b*(b-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = list(map(int, input()))
 
if c >= a:
  c -= a
  b -= c
  print(0, b)
else:
  print(a-c, b)

Fixed submission:
a, b, c = map(int, input().split(' '))
 
if c >= a:
  c -= a
  b = max(0, b-c)
  print(0, b)
else:
  print(a-c, b)

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

if c >= a:
  c -= a
  b -= c
  print(0, b)
else:
  print(a-c, b)

Fixed submission:
a, b, c = map(int, input().split(' '))
 
if c >= a:
  c -= a
  b = max(0, b-c)
  print(0, b)
else:
  print(a-c, b)
Buggy python submission (verdict: Runtime Error):
a,b,c = list(map(lambda int: input().split(' '))
print(c-a+b)

Fixed submission:
a,b,c = list(map(int, input().split(' ')))
print(max(0, c-a+b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
z = 1000000000
if n > z:
  	a = n//z
    b = n%z
	print(a, 0, z, b+1, 0, b)
else:
  	print(n, 0, 1, 1, 0, 0)

Fixed submission:
n = int(input())
z = 1000000000
 
if n==z*z:
	print(z, 0, 0, z, 0, 0)
elif n > z:
    a = n//z
    b = n%z
    print(a+1, b, 0, z, 1, 0)
else:
    print(n, 0, 1, 1, 0, 0)
Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else break
  s+=i
print(ans)

Fixed submission:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i

if s<=k: ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if(s<=k) ans+=1
  else break
  s+=i
print(ans)


Fixed submission:
n,k=map(int, input().split(' '))
a=list(map(int, input().split(' ')))
ans,s=0,0
for i in a:
  if s<=k: ans+=1
  else: break
  s+=i

if s<=k: ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, A, B, C = map(int, input().split())
l = [int(input()) for i in range(N)]
INF = 10**9

def dfs(cur, a, b, c):
    if cur == N:
        return abs(a-A) + abs(b-B) + abs(c-C) - 30 if min(a,b,c)>0 else INF

    ans = INF
    ans = min(ans, dfs(cur+1, a, b, c))
    ans = min(ans, dfs(cur+1, a + l[cur], b, c)+10)
    ans = min(ans, dfs(cur+1, a, b+l[cur], c)+10)
    ans = min(ans, dfs(cur+1, a, b, c+l[cur])+10)
    return ans

print(dfs(0, 0, 0, 0))

Fixed submission:
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d <= 30):
		print("Heisei")
	else:
		print("TBD")
else:
	print("TBD")

Buggy python submission (verdict: Runtime Error):
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d < 30):
     	print("Heisei")
	else:
    	print("TBD")
else:
    print("TBD")

Fixed submission:
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d <= 30):
		print("Heisei")
	else:
		print("TBD")
else:
	print("TBD")

Buggy python submission (verdict: Runtime Error):
y, m, d = map(int, input().splite('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d < 30):
     	print("Heisei")
	else:
    	print("TBD")
else:
    print("TBD")

Fixed submission:
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d <= 30):
		print("Heisei")
	else:
		print("TBD")
else:
	print("TBD")

Buggy python submission (verdict: Runtime Error):
y, m, d = map(int, input().splite(' '))

if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d < 30):
     	print("Heisei")
	else:
    	print("TBD")
else:
    print("TBD")

Fixed submission:
y, m, d = map(int, input().split('/'))
 
if y < 2019:
	print("Heisei")
elif y == 2019:
	if m < 4 or (m == 4 and d <= 30):
		print("Heisei")
	else:
		print("TBD")
else:
	print("TBD")
Buggy python submission (verdict: Runtime Error):
ri = lambda: map(int, input().split(' '))
L = [1]
C = [1]

def rec(n, x):
	if x <= 1:
		return 0

	if x == L[n]:
		return 2*C[L-1] + 1

	ans = 0
	if x >= L[n-1] + 2:
		ans += C[n-1] + 1
		ans += rec(n-1, x-L[n-1]-2)
	else:
		ans += rec(n-1, x-1)

	return ans

if __name__ == '__main__':
	N, X = ri()
	for i in range(1, N+1):
		L.append(2*L[i-1] + 3)
		C.append(2*C[i-1] + 1)
	ans = rec(N, X)
	print(ans)



Fixed submission:
ri = lambda: map(int, input().split(' '))
L = [1]
C = [1]

def rec(n, x):
	if x == 0:
		return 0

	if n == 0:
		return 1

	if x == L[n]:
		return 2*C[n-1] + 1

	ans = 0
	if x >= L[n-1] + 2:
		ans += C[n-1] + 1
		ans += rec(n-1, x-L[n-1]-2)
	else:
		ans += rec(n-1, x-1)

	return ans

if __name__ == '__main__':
	N, X = ri()
	for i in range(1, N+1):
		L.append(2*L[i-1] + 3)
		C.append(2*C[i-1] + 1)
	ans = rec(N, X)
	print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(input())
if k==2:
  a,b=map(int, input().split(' '))
  print(a+b)
else:
  print("Hello World")

Fixed submission:
k = int(input())
if k==2:
  a = int(input())
  b = int(input())
  print(a+b)
else:
  print("Hello World")
Buggy python submission (verdict: Runtime Error):
n = input()
a = ['111','222','333','444','555','666','777','888','999']

for i in a:
	if i >= n:
    	print(i)
        break

Fixed submission:
n = input()
a = ['111','222','333','444','555','666','777','888','999']
 
for i in a:
    if i >= n:
        print(i)
        break
Buggy python submission (verdict: Runtime Error):
x = int(input())
if x >= 1200:
	pirnt('ARC')
else:
    print('ABC')


Fixed submission:
x = int(input())
if x >= 1200:
	print('ARC')
else:
    print('ABC')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
xs = []
ls = []
for _ in range(n):
    x, l = map(int, input().split())
    xs.append(x)
    ls.append(l)

ok = [True for _ in range(n)]

def f(i):
    rs = []
    for j in range(n):
        if i == j or not ok[j]:
            continue
        if xs[i] - ls[i] < xs[j] + ls[j] and xs[j] - ls[j] < xs[i] + ls[i]:
            rs.append(j)
    return rs

for i in range(n):
    if not ok[i]:
        continue

    rs = f(i)
    if len(rs) == 1:
        j = rs[0]
        ts = f(j)
        if len(ts) == 0:
            ok[i] = False
        else:
            ok[j] = False
    elif len(rs) > 1:
        ok[i] = False

c = 0
for v in ok:
    if v:
        c += 1
print(c)



Fixed submission:
n = int(input())
robots = []
for _ in range(n):
    x, l = map(int, input().split())
    robots.append((x + l, x - l))
robots.sort()

cur = -float('inf')
ans = 0
for i in range(n):
    t, s = robots[i]
    if cur <= s:
        ans += 1
        cur = t

print(ans)
Buggy python submission (verdict: Runtime Error):
import functools, sys

x, y = map(int, input().split())

mod = 10 ** 9 + 7

def modpow(x, y):
    z = 1
    while y > 0:
        if y % 2 == 0:
            x = (x * x) % mod
            y //= 2
        else:
            z = (z * x) % mod
            y -= 1
    return z

def modinv(x):
    return modpow(x, mod - 2)

def c(n, r):
    if n == r or r == 0:
        return 1

    fct = [None] * (n + 1)
    fct[0] = 1
    for i in range(1, n + 1):
        fct[i] = fct[i - 1] * i % mod
    return fct[n] * (modinv(fct[n - r]) * modinv(fct[r]) % mod) % mod

def f():
    if (2 * y - x) % 3 != 0:
        return 0
    a = (2 * y - x) // 3
    b = y - 2 * a
    if b < 0:
        return 0
    
    return c(a + b, a)

print(f())

Fixed submission:
import functools, sys

x, y = map(int, input().split())

mod = 10 ** 9 + 7

def modpow(x, y):
    z = 1
    while y > 0:
        if y % 2 == 0:
            x = (x * x) % mod
            y //= 2
        else:
            z = (z * x) % mod
            y -= 1
    return z

def modinv(x):
    return modpow(x, mod - 2)

def c(n, r):
    if n == r or r == 0:
        return 1

    fct = [None] * (n + 1)
    fct[0] = 1
    for i in range(1, n + 1):
        fct[i] = fct[i - 1] * i % mod
    return fct[n] * (modinv(fct[n - r]) * modinv(fct[r]) % mod) % mod

def f():
    if 2 * y - x < 0 or (2 * y - x) % 3 != 0:
        return 0
    a = (2 * y - x) // 3
    b = y - 2 * a
    if b < 0:
        return 0
    
    return c(a + b, a)

print(f())
Buggy python submission (verdict: Time Limit Exceeded):
import collections

n, t = map(int, input().split())
tpls = list(sorted(tuple(map(int, input().split())) for _ in range(n)))
a = [None] * n
b = [None] * n
for i in range(n):
    a[i], b[i] = tpls[i]

dp = [collections.defaultdict(int) for _ in range(n + 1)]
dp[0][0] = 0
for i in range(n):
    for cur in dp[i]:
        dp[i + 1][cur] = max(dp[i + 1][cur], dp[i][cur])
        if cur < t:
            dp[i + 1][cur + a[i]] = max(dp[i + 1][cur + a[i]], dp[i][cur] + b[i])
print(max(dp[n].values()))

Fixed submission:
import collections

n, t = map(int, input().split())
tpls = list(sorted(tuple(map(int, input().split())) for _ in range(n)))
a = [None] * n
b = [None] * n
for i in range(n):
    a[i], b[i] = tpls[i]

dp = [[0] * (t + 1) for _ in range(n + 1)]
for i in range(n):
    for j in range(t):
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        k = min(t, j + a[i])
        dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + b[i])
print(max(map(max, dp)))

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

n, t = map(int, input().split())
a = [None] * n
b = [None] * n
for i in range(n):
    a[i], b[i] = map(int, input().split())

dp = [collections.defaultdict(int) for _ in range(n + 1)]
dp[0][0] = 0
for i in sorted(range(n), key=lambda x: a[x]):
    for cur in dp[i]:
        dp[i + 1][cur] = max(dp[i + 1][cur], dp[i][cur])
        if cur < t:
            dp[i + 1][cur + a[i]] = max(dp[i + 1][cur + a[i]], dp[i][cur] + b[i])
print(max(dp[n].values()))

Fixed submission:
import collections

n, t = map(int, input().split())
tpls = list(sorted(tuple(map(int, input().split())) for _ in range(n)))
a = [None] * n
b = [None] * n
for i in range(n):
    a[i], b[i] = tpls[i]

dp = [[0] * (t + 1) for _ in range(n + 1)]
for i in range(n):
    for j in range(t):
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j])
        k = min(t, j + a[i])
        dp[i + 1][k] = max(dp[i + 1][k], dp[i][j] + b[i])
print(max(map(max, dp)))
Buggy python submission (verdict: Runtime Error):
import math

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

if x * 2 <= a * a * b:
    P = (2 * x) / (a * b)
    Q = b
else:
    P = a
    Q = (2 * (a * a * b - x)) / (a * a)

R = math.sqrt(P * P + Q * Q)
cosp = (Q * Q + R * R - P * P) / (2 * Q * R)
print(90 - math.degrees(math.acos(cosp)))

Fixed submission:
import math

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

if a * a * b == x:
    print(0)
    exit(0)

if x * 2 <= a * a * b:
    P = (2 * x) / (a * b)
    Q = b
else:
    P = a
    Q = (2 * (a * a * b - x)) / (a * a)

R = math.sqrt(P * P + Q * Q)
cosp = (Q * Q + R * R - P * P) / (2 * Q * R)
print(90 - math.degrees(math.acos(cosp)))

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

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

if x * 2 <= a * a * b:
    P = (2 * x) / (a * b)
    Q = b
else:
    P = a
    Q = (2 * (a * a * b - x)) / (a * a)

R = math.sqrt(P * P + Q * Q)
cosp = (Q * Q + R * R - P * P) / (2 * Q * R)
print(90 - math.degrees(math.acos(cosp)))

Fixed submission:
import math

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

if a * a * b == x:
    print(0)
    exit(0)

if x * 2 <= a * a * b:
    P = (2 * x) / (a * b)
    Q = b
else:
    P = a
    Q = (2 * (a * a * b - x)) / (a * a)

R = math.sqrt(P * P + Q * Q)
cosp = (Q * Q + R * R - P * P) / (2 * Q * R)
print(90 - math.degrees(math.acos(cosp)))
Buggy python submission (verdict: Time Limit Exceeded):
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
f = list(map(int, input().split()))

a.sort(reverse=True)
f.sort(reverse=False)

def isok(mid):
    total = 0
    for i in range(n):
        if a[i] * f[i] <= mid:
            continue
        total += a[i] - mid // f[i]
    return total <= k

ng = -1
ok = a[0] * f[-1] + 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2

    if isok(mid):
        ok = mid
    else:
        ng = mid

print(ok)

Fixed submission:
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))
f = list(map(int, input().split()))

a.sort(reverse=True)
f.sort(reverse=False)

def isok(mid):
    total = 0
    for i in range(n):
        if a[i] * f[i] <= mid:
            continue
        total += a[i] - mid // f[i]
    return total <= k

ng = -1
ok = a[0] * f[-1] + 1
while abs(ok - ng) > 1:
    mid = (ok + ng) // 2
    if isok(mid):
        ok = mid
    else:
        ng = mid

print(ok)
Buggy python submission (verdict: Runtime Error):
s = int(input())
v = 10 ** 9
x1 = 0
y1 = 0
x2 = v
y2 = 1
x3 = (v - s % v) % v
y3 = (s + x) // v
print(x1, y1, x2, y2, x3, y3)

Fixed submission:
s = int(input())
v = 10 ** 9
x1 = 0
y1 = 0
x2 = v
y2 = 1
x3 = (v - s % v) % v
y3 = (s + x3) // v
print(x1, y1, x2, y2, x3, y3)
Buggy python submission (verdict: Time Limit Exceeded):
l, r = map(int, input().split())
ans = float('inf')
for i in range(l, min(l + 2019, r + 1)):
    for j in range(i + 1, min(r + 2019, r + 1)):
        ans = min(ans, (i * j) % 2019)
print(ans)

Fixed submission:
l, r = map(int, input().split())
ans = float('inf')
for i in range(l, min(l + 2019, r + 1)):
    for j in range(i + 1, min(l + 2019, r + 1)):
        ans = min(ans, (i * j) % 2019)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())

factors = set((n, ))
for factor in range(2, math.ceil(math.sqrt(n))):
    if n % factor == 0:
        factors.add(factor)
        factors.add(n // factor)

total = 0
for factor in factors:
    k = factor - 1
    div = n // k
    mod = n % k
    if div == mod:
        total += k

print(total)

Fixed submission:
n = int(input())

factors = set()
factor = 1
while factor * factor <= n:
    if n % factor == 0:
        factors.add(factor)
        factors.add(n // factor)
    factor += 1

total = 0
for factor in factors:
    k = factor - 1
    if k <= 0:
        continue

    div = n // k
    mod = n % k
    if div == mod:
        total += k

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

n = int(input())
a = list(map(int, input().split()))

# s = [-1, *a[:-1]]
# t = [*a[1:], -1]
s = [-1] * n
t = [-1] * n
for x in range(0, n - 1):
    s[x + 1] = a[x]
for x in range(1, n):
    t[x - 1] = a[x]

for x in range(1, n - 1):
    s[x + 1] = math.gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = math.gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, math.gcd(x, y))
    
print(ans)

Fixed submission:
def gcd(a, b):
    a, b = min(a, b), max(a, b)
    while b % a != 0:
        a, b = b % a, a
    return a


n = int(input())
a = list(map(int, input().split()))

# s = [-1, *a[:-1]]
# t = [*a[1:], -1]
s = [-1] * n
t = [-1] * n
for x in range(0, n - 1):
    s[x + 1] = a[x]
for x in range(1, n):
    t[x - 1] = a[x]

for x in range(1, n - 1):
    s[x + 1] = gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, gcd(x, y))
    
print(ans)

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

n = int(input())
a = list(map(int, input().split()))

s = [-1, *a[:-1]]
t = [*a[1:], -1]
for x in range(1, n - 1):
    s[x + 1] = math.gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = math.gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, math.gcd(x, y))
    
print(ans)

Fixed submission:
def gcd(a, b):
    a, b = min(a, b), max(a, b)
    while b % a != 0:
        a, b = b % a, a
    return a


n = int(input())
a = list(map(int, input().split()))

# s = [-1, *a[:-1]]
# t = [*a[1:], -1]
s = [-1] * n
t = [-1] * n
for x in range(0, n - 1):
    s[x + 1] = a[x]
for x in range(1, n):
    t[x - 1] = a[x]

for x in range(1, n - 1):
    s[x + 1] = gcd(s[x + 1], s[x])
for x in range(n - 2, 0, -1):
    t[x - 1] = gcd(t[x - 1], t[x])

ans = -float('inf')
for x, y in zip(s, t):
    if x == -1:
        ans = max(ans, y)
    elif y == -1:
        ans = max(ans, x)
    else:
        ans = max(ans, gcd(x, y))
    
print(ans)