Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sympy

N = int(input())

cnt = 0
for i in range(1, N + 1, 2):
    if len(sympy.divisors(i)) == 8:
        cnt += 1

print(cnt)

Fixed submission:
N = int(input())

ans = 0
for i in range(1, N + 1, 2):
    cnt = 0
    for j in range(1, i + 1):
        if i % j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
        cnt = 0
    
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )

Fixed submission:
L = list(map(int,input().split()))
ans = 0
min_L = min(L)
L.remove(min_L)
cnt = min_L
sorted_L = sorted(L)
for i in sorted_L:
    ans += abs(i - cnt )
    cnt = i
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L - N) )

Fixed submission:
N = int(input())
L = [int(i) for i in input().split()]
print(sum(L) - N)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
cnt = [1]
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
    
print(max(cnt))

Fixed submission:
N = int(input())
cnt = [1]
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
        else:
            break
    
print(max(cnt))

Buggy python submission (verdict: Runtime Error):
N = int(input())
cnt = []
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
    
print(max(cnt))

Fixed submission:
N = int(input())
cnt = [1]
for i in range(1,N + 1):
    for j in range(2,N + 1):
        if i ** j <= N:
            cnt.append(i ** j)
        else:
            break
    
print(max(cnt))
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())

if (b - a + 1) > 2 * k:
    for i in range(a,a + k):
        print(i)
    for i in range(b - k + 1,b + 1):
        print(i)
else:
    for i in range(a,b + 1):
        print(i)

Fixed submission:
# coding: utf-8
import re
S = input()
find_a = re.findall("a",S)
find_b = re.findall("b",S)
find_c = re.findall("c",S)
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())
li = list(range(a,b + 1))
if (b - a + 1) > 2 * k:
    for i in li[:k]:
        print(i)
    for i in li[-k:]:
        print(i)
else:
    for i in li:
        print(i)

Fixed submission:
# coding: utf-8
import re
S = input()
find_a = re.findall("a",S)
find_b = re.findall("b",S)
find_c = re.findall("c",S)
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
import re
S = input()
find_a= re.findall("a")
find_b = re.findall("b")
find_c = re.findall("c")
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")

Fixed submission:
# coding: utf-8
import re
S = input()
find_a = re.findall("a",S)
find_b = re.findall("b",S)
find_c = re.findall("c",S)
if find_a and find_b and find_c:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a* b % 2 == 0:
    print("Even")
eles:
    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,b = map(int,input().split())
S = input()
def crazy(a,b,S):
    num = "0123456789"
    S = S[:A] + S[A+1:]
    if S[a] != "-":
        return False
    for i in S[:a]:
        if i not in num:
            return False
    return True

if crazy(a,b,S):
    print("Yes")
else:
    print("No")

Fixed submission:
#coding: utf-8
M = int(input())
x = 24 + (24 - M) 
print(x)

Buggy python submission (verdict: Runtime Error):
#coding: utf-8
import re
A,B = map(int,input().split())
S = input()
find_underscore = re.findall("\-",S[A])
find_num_a = re.findall("[0-9]",S[:A-1])
find_num_b = re.findall("[0-9]",S[A+1:])
if find_underscore and find_num_a and find_num_b:
    print("Yes")
else:
    print("No")

Fixed submission:
#coding: utf-8
M = int(input())
x = 24 + (24 - M) 
print(x)
Buggy python submission (verdict: Runtime Error):
def abe(n):
    count = 0
    while n % 2 ==0:
        n = n / 2
        count += 1
    return count

x = int(input())
y = map(int,input().split())
z = min(map(abe,y))
print(z)

Fixed submission:
S = input()
count = 0
for i in S:
    if i == "1":
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
K = int(input())
x = list(map(int,input().split()))

cnt = 0
for i in x:
    cnt += 2 * min(i,K - i)

print(cnt)


Fixed submission:
N = int(input())
A = int(input())

print(N ** 2 - A)
Buggy python submission (verdict: Runtime Error):
n,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: Runtime Error):
A,B = map(intinput().split())

if A % 3 == 0 or B % 3 == 0 or (A + B)  % 3 == 0:
  print("Possible")
else:
  print("Impossible")
  

Fixed submission:
A,B = map(int,input().split())

if A % 3 == 0 or B % 3 == 0 or (A + B)  % 3 == 0:
    print("Possible")
else:
    print("Impossible")
Buggy python submission (verdict: Runtime Error):
n, a, b = map(int, input().split())A
print((b - a) * (n - 2) + 1)


Fixed submission:
n, a, b = map(int, input().split())
x = a * n - a + b
y = b * n - b + a


if a > b:
    print(0)
elif a == b and n == 1:
    print(1)
elif a != b and n == 1:
    print(0)
else:
    print(y - x + 1)
Buggy python submission (verdict: Runtime Error):
x,y = map(int,input().split())

li =[[1,3,5,7,8,10,12],[4,6,9,11],[2]]

for i in li:
    if x and y in i:
        print("Yes")
        sys.exit()
print("No")

Fixed submission:
# coding: utf-8
gl=[[1,3,5,7,8,10,12],[4,6,9,11],[2]]
x,y=map(int,input().split())
for g in gl:
    if x in g and y in g:
        print('Yes')
        exit()
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 1
for i in range(1,N + 1):
    ans *=  i 
ans %= (10 ** 9 + 7)
print(ans)

Fixed submission:
N = int(input())

ans = 1
mod = 10**9 + 7

for i in range(1, N + 1):
    ans = (ans * i) % mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 1
for i in range(1,N + 1):
    ans *=  i 
ans %= (10 ** 9 + 7)
print(ans)

Fixed submission:
N = int(input())

ans = 1
mod = 10**9 + 7

for i in range(1, N + 1):
    ans = (ans * i) % mod

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 1
for i in range(1,N + 1):
    ans = ans * i 

ans = ans % (10 ** 9 + 7)
print(ans)

Fixed submission:
N = int(input())

ans = 1
mod = 10**9 + 7

for i in range(1, N + 1):
    ans = (ans * i) % mod

print(ans)
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 k in range(K + 1):
            if i + j + k == S:
                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):
        k = S - i - j
        if 0<= k <= K:
            cnt += 1
                
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, x = map(int,input().split())
cnt = 0
for i in range(a,b + 1):
    if i % x == 0:
        cnt += 1
        
print(cnt)

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

if a != 0:
    print((b // x) - ((a - 1) // x))
else:
    print(b // x + 1)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,x = map(int,input().split())
ans = 0
for i in range(a,b + 1):
    if i % x == 0:
        ans += 1
print(ans)

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

if a != 0:
    print((b // x) - ((a - 1) // x))
else:
    print(b // x + 1)
Buggy python submission (verdict: Runtime Error):
N,K,X,Y = map(int,input().split())
if N < K:
    print(X * N)
else:
    print(K * X + (N - K) * Y)

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

Buggy python submission (verdict: Runtime Error):
N,K,X,Y = map(int,input().split())
price = 0
for i in range(1,N+1):
    if i <= K:
        price += X
    else:
        price += Y
print(price)

Fixed submission:
N = int(input())
K = int(input()) 
X = int(input())
Y = int(input())
if N < K:
    print(X * N)
else:
    print(K * X + (N - K) * Y)
Buggy python submission (verdict: Runtime Error):
n = int(input())
print((10**n -2*9**n + 8**n)/1000000007)

Fixed submission:
n = int(input())
print((10**n -2*9**n +8**n) % 1000000007)

Buggy python submission (verdict: Runtime Error):
n = int(input())
if n >=2:
  ans = (10**(n-2)*n*(n-1))/(10**9 + 7)
else:
  ans = 0
print(ans)

Fixed submission:
n = int(input())
print((10**n -2*9**n +8**n) % 1000000007)
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split(" ")]
result = 1
for idx in A:
	result *= idx
if result <= 10**18:
	print(result)
else:
 	print(-1)

Fixed submission:
data = input().split(" ")
a ,b= int(data[0]) , int(data[1])
print(a*b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input(" ").split()]
 
result = 1
for idx in A:
    result *= idx
if result <= 10**18:
	print(result)
else:
 	print("-1")

Fixed submission:
data = input().split(" ")
a ,b= int(data[0]) , int(data[1])
print(a*b)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = [int(x) for x in input().split()]

result = 1
for idx in A:
  result *= idx
  
if result >= 10**18:
  print("-1")
else:
  print(result)

Fixed submission:
data = input().split(" ")
a ,b= int(data[0]) , int(data[1])
print(a*b)
Buggy python submission (verdict: Runtime Error):
print(chir(ord(input())+1))

Fixed submission:
print(chr(ord(input()) + 1))
Buggy python submission (verdict: Runtime Error):
a, b = map(int,inptu().split())
r = []
r.append(a+b)
r.append(a-b)
r.append(a*b)
print(max(r))


Fixed submission:
a, b = map(int,input().split())
r = []
r.append(a+b)
r.append(a-b)
r.append(a*b)
print(max(r))
Buggy python submission (verdict: Runtime Error):
data_num = [int(i) for i in input().split(" ")]
data = [input() for i in range(data_num[0])]
for i in data:
  	print(i)	
    print(i)


Fixed submission:
data_num = [int(i) for i in input().split(" ")]
data = [input() for i in range(data_num[0])]
for i in data:
  print(i)
  print(i)
Buggy python submission (verdict: Runtime Error):
data = [int(input()) for i in range(3)]
result = data[0]+data[1])*data[2]*0.5
if result == int(result) :
  print(int(result))
else :
  print(result)

Fixed submission:
data = [int(input()) for i in range(3)]
result = (data[0]+data[1])*data[2]*0.5
if result == int(result) :
  print(int(result))
else :
  print(result)
Buggy python submission (verdict: Runtime Error):
children = int(input())
total = 0

for i in range(chldren):
  total += i+1
print(total)

Fixed submission:
children = int(input())
total = 0
for i in range(children):
  i += 1
  total += i
print(total)
Buggy python submission (verdict: Runtime Error):
tupni = [int(idx) for idx in input.split(" ")]
if tupni.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")


Fixed submission:
data = [int(i) for i in input().split(" ")]
total = 0
for i in data:
    if i==7 or i==5:
        total += i
if total == 17:
  	print("YES")
else:
  	print("NO")

Buggy python submission (verdict: Runtime Error):
tupni = [int(idx) for idx in input.split()]
if tupni.sort() == [5,5,7]:
  print("YES")
else:
  print("NO")

Fixed submission:
data = [int(i) for i in input().split(" ")]
total = 0
for i in data:
    if i==7 or i==5:
        total += i
if total == 17:
  	print("YES")
else:
  	print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 1
for i in a:
    ans *= i
if ans > 1e18: print("-1")
else: print(ans)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 1
mark = False
if 0 in a:
    print(0)
    mark = True
if mark==False:
    for i in range(n):
        ans *= a[i]
        if ans > 1000000000000000000:
            mark = True
            print(-1)
            break
if not mark: print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
ac,wa,tle,re=0,0,0,0
for i in range(n):
  hoge=input()
  if(hoge="AC"):
    ac+=1
  elif(hoge="WA"):
    wa+=1
  elif(hoge="TLE"):
    tle+=1
  elif(hoge="RE"):
    re+=1
    
print("AC x "+ac)
print("WA x "+wa)
print("TLE x "+tle)
print("RE x "+re)

Fixed submission:
n=int(input())
ac,wa,tle,re=0,0,0,0
for i in range(n):
  hoge=input()
  if(hoge=="AC"):
    ac+=1
  elif(hoge=="WA"):
    wa+=1
  elif(hoge=="TLE"):
    tle+=1
  elif(hoge=="RE"):
    re+=1
    
print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))
Buggy python submission (verdict: Runtime Error):
a,b,h,m=map(int, input().split())import math
a,b,h,m=map(int, input().split())
a_x=math.cos(math.radians(30*h+0.5*m))
a_y=math.sin(math.radians(30*h+0.5*m))
b_x=math.cos(math.radians(60*m))
b_y=math.sin(math.radians(60*m))
print((abs(a*a_x-b*b_x)**2+abs(a*a_y-b*b_y)**2)**0.5)

Fixed submission:
import math
a,b,h,m=map(int, input().split())
a_x=math.cos(abs(math.radians(6*m)-math.radians(30*h+0.5*m)))
print((a**2+b**2-2*a*b*a_x)**0.5)
Buggy python submission (verdict: Runtime Error):
n,m=map(input,int().split())
if(n>m):
  print("safe")
else:
  print("unsafe")

Fixed submission:
n,m=map(int,input().split())
if(n>m):
  print("safe")
else:
  print("unsafe")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
hoge=list(map(int,input().split()))

if(sum(hoge)>n):
  print(-1)
else:
  print(n-sum(hoge))


Fixed submission:
n=int(input())

print(2*n*3.141592)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
keys = [k for k, v in hoge.items() if v ==max(hoge.values())]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])


Fixed submission:
n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
    
key_max=max(hoge.values())
keys = [k for k, v in hoge.items() if v ==key_max]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
keys = [k for k, v in hoge.items() if v ==max(hoge.values())]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])

Fixed submission:
n=int(input())
hoge={}
for i in range(n):
  tmp=input()
  if(tmp in  hoge):
    hoge[tmp]+=1
  else:
    hoge[tmp]=1
    
key_max=max(hoge.values())
keys = [k for k, v in hoge.items() if v ==key_max]
hoge=sorted(keys)
for i in range(len(hoge)):
  print(hoge[i])
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
wa=0
hoge=[0 for i in range(n)]
huga=[0 for i in range(n)]
for i in range(m):
  a,b=map(str,input().split())
  if(hoge[int(a)-1]==0 and b=="AC"):
    hoge[int(a)-1]=1
  if(hoge[int(a)-1]==0 and b=="WA"):
    huga[int(a)-1]=1
    
for i in range(n):
  if(hoge[i]==0):
    huga=0
    
print(sum(hoge),sum(huga))

Fixed submission:
n,m=map(int,input().split())
hoge=[0 for i in range(n)]
huga=[0 for i in range(n)]
for i in range(m):
  a,b=map(str,input().split())
  if(hoge[int(a)-1]==0 and b=="AC"):
    hoge[int(a)-1]=1
  if(hoge[int(a)-1]==0 and b=="WA"):
    huga[int(a)-1]+=1
    
for i in range(n):
  if(hoge[i]==0):
    huga[i]=0
    
print(sum(hoge),sum(huga))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge=list(map(int,input().split()))
for i in range(n):
  print(1+hoge.index(i+1),end=" ")
print(" ")

Fixed submission:
n=int(input())
hoge=list(map(int,input().split()))
huga=[0]*n
for i in range(n):
  huga[hoge[i]-1]=i+1
for i in huga:
  print(i,end=" ")
print(" ")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
ans=0
hoge=[]
for i in range(n):
  a=list(input())
  a.sort()
  if(hoge.count(a)==0):
    hoge.append(a)
  else:
    ans+=hoge.count(a)
    hoge.append(a)
print(ans)

Fixed submission:
n=int(input())
dic={}
for i in range(n):
  hoge=list(input())
  hoge.sort()
  hoge=str(hoge)
  if(hoge in dic):
    dic[hoge]+=1
  else:
    dic[hoge]=1


ans=0
for i in dic.values():
  ans+=i*(i-1)//2
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b=int(input())
if(b==1):
  print(0)
else:
  print(a-b)

Fixed submission:
a,b=map(int,input().split())
if(b==1):
  print(0)
else:
  print(a-b)
Buggy python submission (verdict: Runtime Error):
fib=[0,1]
for i in range(10001):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[-1]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
for i in range(len(hoge)-1):
  sa=hoge[i+1]-hoge[i]-1
  ans=ans*fib[sa]
  ans=ans%1000000007
print(ans)

Fixed submission:
fib=[0,1]
for i in range(100000):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[-1]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
for i in range(len(hoge)-1):
  sa=hoge[i+1]-hoge[i]-1
  ans=ans*fib[sa]
  ans=ans%1000000007
print(ans)

Buggy python submission (verdict: Runtime Error):
fib=[0,1]
for i in range(9999):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[-1]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
for i in range(len(hoge)-1):
  sa=hoge[i+1]-hoge[i]-1
  ans=ans*fib[sa]
  ans=ans%1000000007
print(ans)

Fixed submission:
fib=[0,1]
for i in range(100000):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[-1]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
for i in range(len(hoge)-1):
  sa=hoge[i+1]-hoge[i]-1
  ans=ans*fib[sa]
  ans=ans%1000000007
print(ans)

Buggy python submission (verdict: Runtime Error):
fib=[0,1]
for i in range(9999):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[0]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
  ans=ans*max(1,fib[hoge[i+1]-hoge[i]-1])
  ans=ans%1000000007
  
print(ans%1000000007)

Fixed submission:
fib=[0,1]
for i in range(100000):
  fib.append(fib[-1]+fib[-2])
  
n,m=map(int,input().split())
hoge=[-1]
ans=1
for i in range(m):
  hoge.append(int(input()))
hoge.append(n+1)

for i in range(len(hoge)-1):
  if(hoge[i+1]-hoge[i]==1):
    print(0)
    exit()
    
for i in range(len(hoge)-1):
  sa=hoge[i+1]-hoge[i]-1
  ans=ans*fib[sa]
  ans=ans%1000000007
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
ans=0

for i in range(1+n//r):
  red=i*r
  for j in range(1+n//g):
    green=j*g
    if((n-red-green)%b==0 and (n-red-green)>=0):
      ans+=1
print(ans)

Fixed submission:
r,g,b,n=map(int,input().split())
ans=0

for i in range(1+n//r):
  red=i*r
  for j in range(1+(n-red)//g):
    green=j*g
    if((n-red-green)%b==0 and (n-red-green)>=0):
      ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
hoge=input()

for i in range(q):
  a,b=map(int,input().split())
  huga=hoge[a-1:b]
  print(huga.count("AC"))

Fixed submission:
n,q=map(int,input().split())
hoge=input()
huga=[0]
for i in range(n-1):
  flag=0
  if(hoge[i]=="A" and hoge[i+1]=="C"):
    flag=1
  huga.append(huga[-1]+flag)

for i in range(q):
  a,b=map(int,input().split())
  print(huga[b-1]-huga[a-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
hoge=list(map(int,input().split()))
###
def huga(a,b):
  x=max(a,b)
  y=min(a,b)
  z=1
  for i in range(y):
    wa=y-i
    if(x%wa==0 and y%wa==0):
      z=wa
      break
  return z
###
hoge.sort(reverse=True)
ans=hoge[0]
for i in range(n-1):
  ans=huga(ans,hoge[i+1])
  
print(ans)

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

if(b%a==0):
  print(a+b)
else:
  print(b-a)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge=list(map(int,input().split()))
###
def huga(a,b):
  x=max(a,b)
  y=min(a,b)
  z=1
  for i in range(y):
    wa=y-i
    if(x%wa==0 and y%wa==0):
      z=wa
      break
  return z
###
hoge.sort(reverse=True)
ans=hoge[0]
for i in range(n-1):
  ans=huga(ans,hoge[i+1])
  
print(ans)

Fixed submission:
def gcd(a,b):
  if(a<b):
    a,b=b,a
  if(b==0):
    return a
  c= a%b
  return gcd(b,c)

n=int(input())
hoge=list(map(int,input().split()))
hoge.sort()
for i in range(n-1):
  hoge[i+1]=gcd(hoge[i],hoge[i+1])
  
print(hoge[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge=list(map(int,input().split()))
###
def huga(a,b):
  x=max(a,b)
  y=min(a,b)
  z=1
  for i in range(y):
    wa=y-i
    if(x%wa==0 and y%wa==0):
      z=wa
      break
  return z
###
hoge.sort()
ans=hoge[0]
for i in range(n-1):
  ans=huga(ans,hoge[i+1])
  
print(ans)

Fixed submission:
def gcd(a,b):
  if(a<b):
    a,b=b,a
  if(b==0):
    return a
  c= a%b
  return gcd(b,c)

n=int(input())
hoge=list(map(int,input().split()))
hoge.sort()
for i in range(n-1):
  hoge[i+1]=gcd(hoge[i],hoge[i+1])
  
print(hoge[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
hoge=list(map(int,input().split()))
###
def huga(a,b):
  x=max(a,b)
  y=min(a,b)
  z=1
  for i in range(y):
    wa=i+1
    if(x%wa==0 and y%wa==0):
      z=wa
  return z
###
hoge.sort()
ans=hoge[0]
for i in range(n-1):
  ans=huga(ans,hoge[i+1])
  
print(ans)

Fixed submission:
def gcd(a,b):
  if(a<b):
    a,b=b,a
  if(b==0):
    return a
  c= a%b
  return gcd(b,c)

n=int(input())
hoge=list(map(int,input().split()))
hoge.sort()
for i in range(n-1):
  hoge[i+1]=gcd(hoge[i],hoge[i+1])
  
print(hoge[-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
hoge=[]
for i in range(n):
  x,y,z=map(int,input().split())
  if(z!=0):
    hoge.append([x,y,z])
  

if(len(hoge)==1):
  print(*hoge[0])
  exit()

for i in range(101):
  for j in range(101):
    h=[]
    for k in range(len(hoge)):
      h.append(hoge[k][2]+abs(hoge[k][0]-i)+abs(hoge[k][1]-j))
      
    if(h.count(h[0])==len(h)):
      print(i,j,h[0])


Fixed submission:
N=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  A=int(input())
  B=int(input())
  print(A+B)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  print(A+B)

Fixed submission:
N=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  A=int(input())
  B=int(input())
  print(A+B)

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=int(input())
B=int(input())
if(N==1):
  print("Hello World")
else:
  print(A+B)

Fixed submission:
N=int(input())
if(N==1):
  print("Hello World")
if(N==2):
  A=int(input())
  B=int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
N,T=map(int, input().split())
ans=9999
for i inrange(N):
  A,B=map(int, input().split())
  if (T>B):
    if(ans>A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)

Fixed submission:
N,T=map(int, input().split())
ans=9999
for i in range(N):
  A,B=map(int, input().split())
  if (T>=B):
    if(ans>=A):
      ans=A
if(ans==9999):
  print("TLE")
else:
  print(ans)