Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[]
#while True:
for u in range(2):
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]<=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')
        

Fixed submission:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]>=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')

Buggy python submission (verdict: Runtime Error):
li=[]
n=int(input())
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break
if li[i][1]<0 or li[i][2]<0 for i in range(n):
    print('NO')
else:
    nl=li[:][1,2]
    for j in range(n-1):
        d=nl[j+1][:]-nl[j][:]
        if not d==[1,0] or [0,1] or [-1,0] or [0,-1]:
            print('NO')
            break
    print('YES')

Fixed submission:
n=int(input())
li=[]
while True:
    try:
        li.append(list(map(int,input().split())))
    except:
        break

#ans=Trueにしておいて、チェックにひっ掛かったらFalseに変える
ans=True

#設定より負の値になっていればNO
for i in range(n):
    if li[i][1]>=0 and li[i][2]>=0:
        continue
    ans=False
    print('No')
    break
        
        
#進める最大値よりも先に存在した場合にNOを出す
if ans==True:
    for j in range(n):
        if li[j][0]>=li[j][1]+li[j][2]:
            continue
        ans=False
        print('No')
        break
#秒数とマス目の和の偶奇を調べる
if ans==True:        
    for k in range(n):
        if li[k][0]%2==(li[k][1]+li[k][2])%2:
            continue
        ans=False
        print('No')
        break
        
if ans==True:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
n=int(input())
li=[int(input()) for i in range(n)]
li_set=list(set(li))        #重複したものを一つにまとめる
print(len(li_s))

Fixed submission:
n=int(input())
li=[int(input()) for i in range(n)]
li_set=list(set(li))        #重複したものを一つにまとめる
print(len(li_set))
Buggy python submission (verdict: Runtime Error):
li=list(map(int,input().split()))
n=li[0]
y=li[1]

for i in range(n):
    for j in range(n-i):
        for k in range(n-i-j):
            if y=10000*i+5000*j+1000*k:
                print(i,j,k)
                break
print(-1,-1,-1)

Fixed submission:
li=list(map(int,input().split()))
n=li[0]
y=li[1]

a,b,c=-1,-1,-1

for i in range(n+1):
    for j in range(n-i+1):
        if y==10000*i+5000*j+1000*(n-i-j):
            a=i
            b=j
            c=n-i-j
            break
print(a,b,c)
Buggy python submission (verdict: Runtime Error):
x=map(int,input().split())

s1=x//100
s2=x//10%10
s3=x%10

print(s1+s2+s3)

Fixed submission:
x=int(input())

s1=x//100
s2=x//10%10
s3=x%10

print(s1+s2+s3)

Buggy python submission (verdict: Runtime Error):
s1,s2,s3=map(int,input().split())

print(s1+s2+s3)

Fixed submission:
x=int(input())

s1=x//100
s2=x//10%10
s3=x%10

print(s1+s2+s3)
Buggy python submission (verdict: Runtime Error):
t=int(input())

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

count=0
while true:
  if li[0:t]%2==0:
  	for i in range(t):
    	li[i]=li[i]/2
    count+=1
	continue
  break
print(count)

Fixed submission:
t=int(input())

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

count=0
while True:
    x=[True if i%2==0 else False for i in li]
    if all(x):
        for i in range(t):
            li[i]=li[i]/2
        count+=1
    else:
        break
print(count)

Buggy python submission (verdict: Runtime Error):
t=int(input())

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

count=0
while true:
  if li[0:t]%2==0:
  	for i in range(t):
    	li[i]=li[i]/2
    count+=1
	else:
  		break
print(count)

Fixed submission:
t=int(input())

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

count=0
while True:
    x=[True if i%2==0 else False for i in li]
    if all(x):
        for i in range(t):
            li[i]=li[i]/2
        count+=1
    else:
        break
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        Sr=Sr[5:]
    elif Sr[:5]==w3:
        Sr=Sr[5:]
    elif Sr[:6]==w4:
        Sr=Sr[6:]
    elif Sr[:7]==w2:
        Sr=Sr[7:]
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')

Fixed submission:
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        del(Sr[:5])
    elif Sr[:5]==w3:
        del(Sr[:5])
    elif Sr[:6]==w4:
        del(Sr[:6])
    elif Sr[:7]==w2:
        del(Sr[:7])
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        Sr=Sr[5:]
    elif Sr[:5]==w3:
        Sr=Sr[5:]
    elif Sr[:6]==w4:
        Sr=Sr[6:]
    elif Sr[:7]==w2:
        Sr=Sr[7:]
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')

Fixed submission:
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        del(Sr[:5])
    elif Sr[:5]==w3:
        del(Sr[:5])
    elif Sr[:6]==w4:
        del(Sr[:6])
    elif Sr[:7]==w2:
        del(Sr[:7])
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')

Buggy python submission (verdict: Time Limit Exceeded):
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        Sr=Sr[5:]
    elif Sr[:5]==w3:
        Sr=Sr[5:]
    elif Sr[:6]==w4:
        Sr=Sr[6:]
    elif Sr[:7]==w2:
        Sr=Sr[7:]
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')

Fixed submission:
T=[]
S=input()
Sr=list(reversed(S))
w1=list(reversed('dream'))
w2=list(reversed('dreamer'))
w3=list(reversed('erase'))
w4=list(reversed('eraser'))

while True:
    if Sr[:5]==w1:
        del(Sr[:5])
    elif Sr[:5]==w3:
        del(Sr[:5])
    elif Sr[:6]==w4:
        del(Sr[:6])
    elif Sr[:7]==w2:
        del(Sr[:7])
    else:
        break
if Sr==T:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
print((n-1)*(m-1))

Fixed submission:
n,m = map(int, input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Time Limit Exceeded):
a = 0
listA = []
N, M = map(int, input().split())
for i in range(N):
    A, B = map(int, input().split())
    for i in range(B):
        listA.append(A)
listA.sort()
for i in range(M):
    a += listA[i]
print(a)

Fixed submission:
a = 0
l = []
f = 0
N, M = map(int, input().split())
for i in range(N):
    A, B = map(int, input().split())
    l.append([A, B])
l_sorted = sorted(l, key=lambda x: x[0])
while True:
    if l_sorted[f][1] < M:
        a += l_sorted[f][1] * l_sorted[f][0]
        M -= l_sorted[f][1]
        f += 1
    else:
        a += M * l_sorted[f][0]
        break
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
a = 0
listA = []
N, M = map(int, input().split())
for i in range(N):
    A, B = map(int, input().split())
    for i in range(B):
        listA.append(A)
listA.sort()
for i in range(M):
    a += listA[i]
print(a)

Fixed submission:
a = 0
l = []
f = 0
N, M = map(int, input().split())
for i in range(N):
    A, B = map(int, input().split())
    l.append([A, B])
l_sorted = sorted(l, key=lambda x: x[0])
while True:
    if l_sorted[f][1] < M:
        a += l_sorted[f][1] * l_sorted[f][0]
        M -= l_sorted[f][1]
        f += 1
    else:
        a += M * l_sorted[f][0]
        break
print(a)
Buggy python submission (verdict: Time Limit Exceeded):
a_0b =0
A, B = map(int, input().split())
for i in range(A, B+1):
    a_0b = i ^ a_0b
print(a_0b)

Fixed submission:
a = 0
A, B = map(int, input().split())
c = (B + 1 - A) // 2
d = (B + 1 - A) % 2
if d == 0 and A % 2 == 0:
    if c % 2 == 0:
        a = 0
    else:
        a = 1
elif d == 0 and A % 2 != 0:
    if (c-1) % 2 == 0:
        a = A ^ B
    else:
        a = 1 ^ A ^ B
elif d == 1 and A % 2 == 0:
    if c % 2 == 0:
        a = B
    else:
        a = 1 ^ B
elif d == 1 and A % 2 != 0:
    if c % 2 == 0:
        a = A
    else:
        a = 1 ^ A
print(a)
Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+w+"#")
print("#"*(w+2))

Fixed submission:
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+t+"#")
print("#"*(w+2))

Buggy python submission (verdict: Runtime Error):
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    w = input()
    print("#"+w+"#")
print("#"*(w+2))
    

Fixed submission:
h,w=map(int,input().split())
print("#"*(w+2))
for i in range(h):
    t = input()
    print("#"+t+"#")
print("#"*(w+2))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int, input().count())
if b-a==c-b:
    print('YES')
else:
    print('NO')

Fixed submission:
a,b,c=map(int, input().split())
if b-a==c-b:
    print('YES')
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = list(map(int, input().split()))
l_2 = []
gusu_kisu = N % 2
end_F = 0
for i in range(N):
    if gusu_kisu == 1:
        An = l[i]
        if An % 2 == 1:
            end_F = 1
            break
        elif An == 0 and l_2.count(0) == 1:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
    else:
        An = l[i]
        if An % 2 == 0:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
#     print(An)
# print(end_F)
if end_F == 0:
    print((2 ** (N // 2)) % 1000000007)
else:
    print(0)

Fixed submission:
c =input()
print(eval(c))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))
l_2 = []
gusu_kisu = N % 2
end_F = 0
for i in range(N):
    if gusu_kisu == 1:
        An = l[i]
        if An % 2 == 1:
            end_F = 1
            break
        elif An == 0 and l_2.count(0) == 1:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
    else:
        An = l[i]
        if An % 2 == 0:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
#     print(An)
# print(end_F)
if end_F == 0:
    print((2 ** (N // 2)) % 1000000007)
else:
    print(0)

Fixed submission:
from collections import Counter

ans_0 = False
N = int(input())
l = list(map(int, input().split()))
l_Counter = Counter(l)
if N % 2 == 1:
    if l_Counter[0] != 1:
        ans_0 = True
    else:
        l_Counter[0] = 2
        for i in l_Counter.items():
            # print(i)
            if i[1] != 2 or i[0] % 2 == 1:
                ans_0 = True
                break
else:
    for i in l_Counter.items():
        # print(i)
        if i[1] != 2 or i[0] == 0 or i[0] % 2 == 0:
            ans_0 = True
            break
#     print(An)
# print(end_0)
if ans_0:
    print(0)
else:
    print((2 ** (N // 2)) % 1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = list(map(int, input().split()))
l_2 = []
gusu_kisu = N % 2
end_F = 0
for i in range(N):
    if gusu_kisu == 1:
        An = l[i]
        if An % 2 == 1:
            end_F = 1
            break
        elif An == 0 and l_2.count(0) == 1:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
    else:
        An = l[i]
        if An % 2 == 0:
            end_F = 1
            break
        elif l_2.count(An) == 2:
            end_F = 1
            break
        else:
            l_2.append(An)
#     print(An)
# print(end_F)
if end_F == 0:
    print((2 ** (N // 2)) % ((10 ** 9) + 7))
else:
    print(0)

Fixed submission:
from collections import Counter

ans_0 = False
N = int(input())
l = list(map(int, input().split()))
l_Counter = Counter(l)
if N % 2 == 1:
    if l_Counter[0] != 1:
        ans_0 = True
    else:
        l_Counter[0] = 2
        for i in l_Counter.items():
            # print(i)
            if i[1] != 2 or i[0] % 2 == 1:
                ans_0 = True
                break
else:
    for i in l_Counter.items():
        # print(i)
        if i[1] != 2 or i[0] == 0 or i[0] % 2 == 0:
            ans_0 = True
            break
#     print(An)
# print(end_0)
if ans_0:
    print(0)
else:
    print((2 ** (N // 2)) % 1000000007)
Buggy python submission (verdict: Runtime Error):
w=input()
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	w=w.replace(s,'')
	if w:
		print('Yes')
		break

Fixed submission:
w=input()
a='Yes'
s='qwertyuiopasdfghjklzxcvbnm'
for i in range(26):
	if w.count(s[i])%2!=0:
		a='No'
		break
print(a)

Buggy python submission (verdict: Runtime Error):
w=input()
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	print(w)
	w=w.replace(s,'')
	print(w)
	if w:
		print('Yes')
		break

Fixed submission:
w=input()
a='Yes'
s='qwertyuiopasdfghjklzxcvbnm'
for i in range(26):
	if w.count(s[i])%2!=0:
		a='No'
		break
print(a)

Buggy python submission (verdict: Runtime Error):
w=str(input())
s=''
while True:
	s=w[0]
	if w.count(s)%2==1:
		print('No')
		break
	w.replane(s,'')
	if w:
		print('Yes')
		break

Fixed submission:
w=input()
a='Yes'
s='qwertyuiopasdfghjklzxcvbnm'
for i in range(26):
	if w.count(s[i])%2!=0:
		a='No'
		break
print(a)
Buggy python submission (verdict: Runtime Error):
import sympy as sym
N = int(input())
l = list(map(int, input().split()))
expr = 0
x = sym.symbols("x")
for i in range(N):
    expr = expr + (l[i] - x)**2
eq = sym.Eq(sym.Derivative(expr).doit())
a = sym.solve(eq, x)
# print(a)
a = a[0]
a = round(a)
# print(a)
a = expr.subs(x, a)
print(a)

Fixed submission:
N = int(input())
l = list(map(int, input().split()))
c = 0
b = 0
for i in range(N):
    c += l[i] ** 2
    b += -2 * l[i]
x = -b / (2 * N)
x = round(x)
Ans = N * x ** 2 + b * x + c

print(Ans)
Buggy python submission (verdict: Runtime Error):
l = list(range(10001))
l = list(map(str, l))
c = 0
N, K = map(int, input().split())
ld = list(map(str, input().split()))
del l[:N]
while True:
    if any(x in l[c] for x in ld):
        c += 1
    else:
        break
print(int(l[c]))

Fixed submission:
c = 0
f = True
N, K = map(int, input().split())
ld = list(map(str, input().split()))
while f:
    i = 0
    N_str = str(N)
    for i in range(K):
        # print(i)
        if ld[i] in N_str:
            N += 1
            break
        elif i == K-1:
            f = False
print(N)

Buggy python submission (verdict: Runtime Error):
l = list(range(10001))
l = list(map(str, l))
print(l)
c = 0
N, K = map(int, input().split())
ld = list(map(str, input().split()))
del l[:N]
while True:
    if any(x in l[c] for x in ld):
        c += 1
    else:
        break
print(int(l[c]))


Fixed submission:
c = 0
f = True
N, K = map(int, input().split())
ld = list(map(str, input().split()))
while f:
    i = 0
    N_str = str(N)
    for i in range(K):
        # print(i)
        if ld[i] in N_str:
            N += 1
            break
        elif i == K-1:
            f = False
print(N)
Buggy python submission (verdict: Runtime Error):
x=int(input())
c=1
for b in range(1,x):
  for p in range(2,x):
    if b**p<=x:c=max(c,b**p)
      else:break
print(c)


Fixed submission:
x=int(input())
c=1
for b in range(1,x):
    for p in range(2,x):
        if b**p<=x:c=max(c,b**p)
        else:break
print(c)
Buggy python submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t))

Fixed submission:
x,t=map(int,input().split())
print(max(0,x-t))

Buggy python submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t))

Fixed submission:
x,t=map(int,input().split())
print(max(0,x-t))

Buggy python submission (verdict: Runtime Error):
x,t=map(int,input().split)
print(max(0,x-t)

Fixed submission:
x,t=map(int,input().split())
print(max(0,x-t))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input())
print(a*b/2)

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

print((a*b)-a-b+1)

Fixed submission:
a,b=map(int,input().split())

print((a*b)-a-b+1)

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

print(a*b-a-b+1)

Fixed submission:
a,b=map(int,input().split())

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

print(-(-(a+b)//2)

Fixed submission:
a,b=map(int,input().split())

print(-(-(a+b)//2))

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

Fixed submission:
a,b=map(int,input().split())

print(-(-(a+b)//2))
Buggy python submission (verdict: Runtime Error):
n=int(input())

if 9 in n:
  print('Yes')
else:
  print('No')

Fixed submission:
n=input()
if '9' in n:
  print('Yes')
else:
  print('No')

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

if n in 9:
  print('Yes')
else:
  print('No')

Fixed submission:
n=input()
if '9' in n:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n,m=int(input().split())
print((n-1)*(m-1))

Fixed submission:
n,m=map(int,input().split())
print((n-1)*(m-1))
Buggy python submission (verdict: Runtime Error):
import math
print(math.factorial(int(input()) % (10**9+7))

Fixed submission:
import math
print(math.factorial(int(input())) % (10**9+7))

Buggy python submission (verdict: Runtime Error):
import math
print(math.factorial(int(input())%10**9+7)

Fixed submission:
import math
print(math.factorial(int(input())) % (10**9+7))
Buggy python submission (verdict: Runtime Error):
a, b = map(int(), input().split())

print((a * b) - a - b + 1)

Fixed submission:
a, b = map(int, input().split())

print((a * b) - a - b + 1)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().sprit())

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

Fixed submission:
a, b = map(int, input().split())


if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
a = int(input())
if 9 in a:
  print("Yes")
else:
  print("No")

Fixed submission:
a = input()
if "9" in a:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
print((a - 1) * (b - 1))

Fixed submission:
a, b = map(int, input().split())
print((a - 1) * (b - 1))
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(round(ans))

# %% 	Coins
a, b, c, x = map(int, [input() for 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:
n = input()
a = list(map(int, input().split()))
ans = float('inf')
for i in a:
    ans = min(ans, len(bin(i)) - bin(i).rfind('1') - 1)
print(round(ans))
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
    k=list(map(int,input().split()))
    for g in range(k[0]):
        a[k[g]]+=1
s=0
for i in range(m):
    if a[i]==n:
        s+=1
print(s)


Fixed submission:
n,m=map(int,input().split())
a=[0 for i in range(m)]
for i in range(n):
    k=list(map(int,input().split()))
    for g in range(k[0]):
        a[k[g+1]-1]+=1
s=0
for i in range(m):
    if a[i]==n:
        s+=1
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
while len(a)>1:
    m=min(a)
    def f(n):
        return n-m
    a=map(f,a)
    a=set(a)
    a.add(m)
    a.remove(0)
    a=list(a)
print(a[0])


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
while len(a)>1:
    m=min(a)
    def f(n):
        return n%m
    a=map(f,a)
    a=set(a)
    a.add(m)
    a.remove(0)
    a=list(a)
print(a[0])

Buggy python submission (verdict: Runtime Error):
n=input()
a=list(map(int,input().split()))
for i in range(0,len(a)):
    a[i]=a[i]%min(a)
    a.append(min(a))
    for j in range(len(a)):
        if a[j]==0:
            a.remove(a[j])
print(a[0])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
while len(a)>1:
    m=min(a)
    def f(n):
        return n%m
    a=map(f,a)
    a=set(a)
    a.add(m)
    a.remove(0)
    a=list(a)
print(a[0])

Buggy python submission (verdict: Runtime Error):
n=input()
a=list(map(int,input().split()))
k=[0,99999999]
for i in range(0,n):
    a[i]=a[i]%min(a)
    a.append(min(a))
    for j in range(n+1):
        if a[j]==0:
            a.remove(a[j])
            n-=1
print(a[0])

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
while len(a)>1:
    m=min(a)
    def f(n):
        return n%m
    a=map(f,a)
    a=set(a)
    a.add(m)
    a.remove(0)
    a=list(a)
print(a[0])
Buggy python submission (verdict: Runtime Error):
mizuyari=0
n=int(input())
s=list(map(int,input().split()))
def hiku(n):
    return n-1
for i in range(100):
    if s[0]>0:
        mizuyari+=1
    for j in range(n-1):
        if s[j]<=0 and s[j+1]>0:
            mizuyari+=1
    s=list(map(hiku,s))
else:
  print(mizuyari)


Fixed submission:
a,b,c=map(int,input().split())
print(str(int(0.5*a*b)))
Buggy python submission (verdict: Runtime Error):
listA = [] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;


field = []
# 縦幅
for(int i = 0; i < listA[0][0]; i++)
    field.appnd([])
    # 横幅
    for(int i = 0; i < listA[0][1]; i++)
        field[i].appnd(0)
        
for(int i = 0; i < listA[1][0]; i++)
    for(int j = 0; j < listA[1][1]; j++)
    field[i][j] = 1
    
cnt = 0
for item in field:
    for i in item:
        cnt++
        
print(cnt)

Fixed submission:
listA = [] #appendのために宣言が必要
while True:
    try:
        listA.append(list(map(int,input().split())))

    except:
        break;

H = listA[0][0]
W = listA[0][1]
h = listA[1][0]
w = listA[1][1]

ans = (H - h) * (W - w)

print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
a = inout()

print(int(n ** 2) - a)

Fixed submission:
n = int(input())
a = int(input())

print(n ** 2 - a)
Buggy python submission (verdict: Runtime Error):
H,W=map(int,input().split())
h,w–map(int,input().split())
print(H*W-H*w-h*W+h*w)

Fixed submission:
H,W=map(int,input().split())
h,w=map(int,input().split())
print(H*W-H*w-h*W+h*w)