Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
 
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 
k,x=map(int,input(),.split())

if k*500>=x:
	print("Yes")
else:
	print("No")

Fixed submission:
import sys
import numpy as np
 
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
 
k,x=map(int,input().split())

if k*500>=x:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
n,a,b=map(int,input().split())

if (b-a)%2==0:
    print((b-a)//2)
else:
    print(min((b+a-1)//2),(2*n-a-b+1)//2)

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

if (b-a)%2==0:
    print((b-a)//2)
else:
    print(min((b+a-1)//2,(2*n-a-b+1)//2))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
cnt=0
i=0
while cnt<sum(a)//2:
    temp=cnt
    cnt+=a[i]
    i+=1
print(min(abs(sum(a)-temp*2),abs(sum(a)-cnt*2)))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
cnt=0
i=0
s=sum(a)
while cnt<s//2:
    temp=cnt
    cnt+=a[i]
    i+=1
    
print(min(abs(sum(a)-temp*2),abs(sum(a)-cnt*2)))
Buggy python submission (verdict: Runtime Error):
import math
a,b,x=map(int,input().split())
if x>((a**2)*b)/2:
    ans=math.degrees(math.atan(a/(2*(b-(x/(a**2))))))
else:
    ans=math.degrees(math.atan((2*x)/(a*(b**2))))
print(90-ans)


Fixed submission:
import math
a,b,x=map(int,input().split())
if a*a*b==x:
    ans=90
elif x>((a**2)*b)/2:
    ans=math.degrees(math.atan(a/(2*(b-(x/(a**2))))))
else:
    ans=math.degrees(math.atan((2*x)/(a*(b**2))))
print(90-ans)
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int(input().split()))

print(max(0,a-2*b))

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

print(max(0,a-2*b))
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
n=int(input())
l=sorted(list(map(int,input().split())))

cnt=0
for i in range(0,n-1):
    for j in range(i+1,n):
        k=bisect.bisect_left(l,l[j]+1)
        p=bisect.bisect_right(l,l[i]+l[j]-1)
        cnt+=p-k
print(cnt)


Fixed submission:
import bisect
n=int(input())
l=sorted(list(map(int,input().split())))

cnt=0
for i in range(0,n-2):
    for j in range(i+1,n-1):
        p=bisect.bisect_right(l,l[i]+l[j]-1)
        cnt+=max(p-j-1,0)
print(cnt)
Buggy python submission (verdict: Runtime Error):
import numpy as np
s=input()
k=int(input())
cnt=1
a=[]
ss=s+"."
for i in range(len(s)):
    if ss[i]==ss[i+1]:
        cnt+=1
    else:
        a.append(cnt)
        cnt=1

pp=0
if s[0]==s[len(s)-1]:
    pp=a[0]+a[-1]
    
    b=[]
    if len(a)>1:
        b.append(pp)
        b+=a[1:len(a)-1]

    else:
        a=[len(s)*k]
        b=[]

arr=np.array(a)
arr2=np.array(b)

a=arr//2
b=arr2//2
if len(s)>=2:
    print(np.sum(a)+int((k-1)*np.sum(b)))
else:
    print(k//2)

Fixed submission:
import numpy as np
s=input()
k=int(input())
cnt=1
a=[]
ss=s+"."
for i in range(len(s)):
    if ss[i]==ss[i+1]:
        cnt+=1
    else:
        a.append(cnt)
        cnt=1

pp=0
if s[0]==s[len(s)-1]:
    pp=a[0]+a[-1]
    
    b=[]
    if len(a)>1:
        b.append(pp)
        b+=a[1:len(a)-1]

    else:
        a=[len(s)*k]
        b=[]

else:
    
    b=a
arr=np.array(a)
arr2=np.array(b)

a=arr//2
b=arr2//2
if len(s)>=2:
    print(np.sum(a)+int((k-1)*np.sum(b)))
else:
    print(k//2)

Buggy python submission (verdict: Runtime Error):
import numpy as np
s=input()
k=int(input())
cnt=1
a=[]
ss=s+"."
for i in range(len(s)):
    if ss[i]==ss[i+1]:
        cnt+=1
    else:
        a.append(cnt)
        cnt=1

pp=0
if s[0]==s[len(s)-1]:
    pp=a[0]+a[-1]
    
b=[]
b.append(pp)
b+=a[1:n-2]
    
arr=np.array(a)
arr2=np.array(b)

a=arr//2
b=arr//2
print(np.sum(a)+(k-1)*np.sum(b))

Fixed submission:
import numpy as np
s=input()
k=int(input())
cnt=1
a=[]
ss=s+"."
for i in range(len(s)):
    if ss[i]==ss[i+1]:
        cnt+=1
    else:
        a.append(cnt)
        cnt=1

pp=0
if s[0]==s[len(s)-1]:
    pp=a[0]+a[-1]
    
    b=[]
    if len(a)>1:
        b.append(pp)
        b+=a[1:len(a)-1]

    else:
        a=[len(s)*k]
        b=[]

else:
    
    b=a
arr=np.array(a)
arr2=np.array(b)

a=arr//2
b=arr2//2
if len(s)>=2:
    print(np.sum(a)+int((k-1)*np.sum(b)))
else:
    print(k//2)
Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
A=list(map(int,input().split()))
L=[]

for j in range(1,N+1):
	item = j
	for index in range(0,N):
		if item==A[index]:
			L.append(index+1)
		

print(*L)

Fixed submission:
import sys
import heapq
from collections import deque
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')



N=int(input())
p=list(map(int,input().split()))	
pp=deque(p)
pp.appendleft(0)

q=sorted(range(len(pp)),key=lambda k:pp[k])
qq=deque(q)
qq.popleft()

print(*qq)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
A=list(map(int,input().split()))
L=[]

for i in range(1,N+1):
	L.append(A.index(i)+1)

print(*L)

Fixed submission:
import sys
import heapq
from collections import deque
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')



N=int(input())
p=list(map(int,input().split()))	
pp=deque(p)
pp.appendleft(0)

q=sorted(range(len(pp)),key=lambda k:pp[k])
qq=deque(q)
qq.popleft()

print(*qq)

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
A=list(map(int,input().split()))
L=[]

for i in range(1,N+1):
	L.append(str(A.index(i)+1))

print(' '.join(L))

Fixed submission:
import sys
import heapq
from collections import deque
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')



N=int(input())
p=list(map(int,input().split()))	
pp=deque(p)
pp.appendleft(0)

q=sorted(range(len(pp)),key=lambda k:pp[k])
qq=deque(q)
qq.popleft()

print(*qq)
Buggy python submission (verdict: Runtime Error):
import sys
from bisect import bisect_left,bisect

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

A=list(map(int,input().split()))
A=sorted(A)

for i in range(m):
	A.insert(bisect_left(A,max(A)//2),max(A)//2)
	del A[n]
	
print(sum(A))

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

if S=="Sunny":
	print("Cloudy")
if S=="Cloudy":
	print("Rainy")
if S=="Rainy":
	print("Sunny")
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K-Q]*N


for i in range(K):
	S[A[i]-1]+=1	
	
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")
	

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K-Q]*N


for i in range(Q):
	S[A[i]-1]+=1	
	
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K-Q]*N


for i in range(K):
	S[A[i]-1]+=1	
	
print(S)
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")
	

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K-Q]*N


for i in range(Q):
	S[A[i]-1]+=1	
	
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K]*N

for i in range(Q):
	S[A[i]-1]+=1
	for j in range(N):
		S[j]-=1
		if S[j]<=0:
			S[j]=-10000000000
		
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")
	

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N,K,Q=map(int,input().split())

A=[int(input()) for _ in range(Q)]
S=[K-Q]*N


for i in range(Q):
	S[A[i]-1]+=1	
	
for k in range(N):
	if S[k]>0:
		print("Yes")
	else:
		print("No")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from bisect import bisect_left,bisect

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())



A=list(map(int,input().split()))
A=sorted(A)

if len(A)>10**5:
	Al=A[-10**5:]
	Af=A[:-10**5]
	for i in range(m):
		Al.insert(bisect_left(Al,max(Al)//2),max(Al)//2)
		del Al[n]
	print(sum(Al)+sum(Af))
	
else:
	for i in range(m):
		A.insert(bisect_left(A,max(A)//2),max(A)//2)
		del A[n]
	
	print(sum(A))



Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import sys
from bisect import bisect_left,bisect

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

A=list(map(int,input().split()))
A=sorted(A)

for i in range(m):
	A.insert(bisect_left(A,max(A)//2),max(A)//2)
	del A[n]
	
print(sum(A))

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

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



for i in range(m):
	A=sorted(A)
	A[n-1]//=2
	
print(sum(A))

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

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

for i in range(m):
	A[A.index(max(A))]//=2
	
print(sum(A))

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))

Buggy python submission (verdict: Time Limit Exceeded):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

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

for i in range(m):
	A[A.index(max(A))]//=2
	
print(sum(A))

Fixed submission:
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))
a = list(map(lambda x: x*(-1), a))  # 各要素を-1倍

heapq.heapify(a)

for i in range(m):
    minimum=heapq.heappop(a)
    mini=((minimum*(-1))//2)*(-1)
    heapq.heappush(a,mini)
    
print(-sum(a))
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
    
    
N=int(input())
l=list(map(int,input().split()))
cnt=0
a=0
for i in range(N-1):
	if l[i]>=l[i+1]:
		cnt+=1
	else:
		if cnt>=a:
			a=cnt
			cnt=0
		else:
			cnt=0
	
if cnt>=a:
	a=cnt	
print(a)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()
T=input()
cnt=0
l=len(S)

for i in range(l):
	if S[i]==T[i]:
		cnt+=1
	
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
import itertools

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
l=list(range(1,N+1))
m=list(itertools.permutations(range(1,N+1)))
le=len(m)
a=0
ans=0

for j in range(le):
	for i in range(N):
		a+=l[i]%m[j][i]
		
	if a>ans:
		ans=a
	a=0

print(ans)
	

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())

print((N*(N-1))//2)

Buggy python submission (verdict: Runtime Error):
import sys
import itertools

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
l=list(range(1,N+1))
m=list(itertools.permutations(range(1,N+1)))
le=len(m)
a=0
ans=0

for j in range(le):
	for i in range(N):
		a+=l[i]%m[j][i]
		
	if a>ans:
		ans=a
	a=0

print(ans)
	

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())

print((N*(N-1))//2)
Buggy python submission (verdict: Runtime Error):

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)

if a=0:
	if b=0:
		if c=0:
			if d=0:
				print(n)
			else:
				print(9)
		else:
		 print(n-90)
	else:
		print(909)
else:
	print(n-9090)
	
print(90909)		

Fixed submission:

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
n=int(input())

a=n//10000
b=(n-10000*a)//1000
c=(n-10000*a-1000*b)//100
d=(n-10000*a-1000*b-100*c)//10
e=(n-10000*a-1000*b-100*c-10*d)


if n==100000:
	print(90909)

elif a==0:
	if b==0:
		if c==0:
			if d==0:
				print(n)
			else:
				print(9)
		else:
		  print(n-90)
	else:
		print(909)
else:
	print(n-9090)
Buggy python submission (verdict: Runtime Error):

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
a, b=map(int,imput().split()))

if a/b==a//b:
	print(a//b)
	
else:
	print("IMPOSSIBLE")

Fixed submission:

    
import sys

if sys.platform =='ios':
	sys.stdin=open('input_file.txt')
	
a, b=map(int,input().split())

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

c=(-((-a)//(2*b+1)))
print(c)

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

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

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

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

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

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

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

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

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

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

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

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

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

print(-((-a)//(2*b+1)))
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,p=map(int,input().split())

print((a*3+b)//2)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
a,b=map(int,input().split())

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

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])


Fixed submission:
n=int(input())

lst=[]
for i in range(1, n+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])

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

lst=[]
for i in range(1, N+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])


Fixed submission:
n=int(input())

lst=[]
for i in range(1, n+1):
    c,p=input().split()
    s=[i,c,int(p)]
    lst.append(s)

s=sorted(lst,key=lambda x: (x[1], -(x[2])))
for i in s:
    print(i[0])
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())

def count(k,i):
    cnt=0
    while k>i:
        i**=2
        cnt+=1
    return cnt

p=0
for i in range(1,n+1):
    p+=((1/2)**(count(k,i)))
print(p/n)

Fixed submission:
import sys
import math

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

A=[]
cnt=0
def count(i,k):
    cnt=0
    while k>i:
        i=i*2
        cnt+=1
        
    return cnt

pro=0

for i in range(1,n+1):
	pro+=(1/2)**count(i,k)
print(pro/n)

Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())

def count(k,i):
    cnt=0
    while k>i:
        i**=2
        cnt+=1
    return cnt

p=0
for i in range(1,n+1):
    p+=((1/2)**(count(k,i)))
print(p/n)

Fixed submission:
import sys
import math

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
   
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

A=[]
cnt=0
def count(i,k):
    cnt=0
    while k>i:
        i=i*2
        cnt+=1
        
    return cnt

pro=0

for i in range(1,n+1):
	pro+=(1/2)**count(i,k)
print(pro/n)
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b==A:
	print("T")
if b==T:
	print("A")
if b==G:
	print("C")
if b==C:
	print("G")



Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
b=input()

if b=="A":
	print("T")
if b=="T":
	print("A")
if b=="G":
	print("C")
if b=="C":
	print("G")
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

if A<="2019/04/30":
	print("Heisei")
else:
	print("TBD")

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
S=input()

if S<="2019/04/30":
	print("Heisei")
else:
	print("TBD")
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

S=set(range(a,m+1))
for i in range(n):
	K,*A=map(int,input().split())
	S&=set(A)
print(len(S))

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
n,m=map(int,input().split())

S=set(range(1,m+1))
for i in range(n):
	K,*A=map(int,input().split())
	S&=set(A)
print(len(S))
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

p=gcd_list(a)

print(p)




Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

p=gcd_list(a)

print(p)

Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

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

p=gcd_list(a)

print(p)




Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

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

p=gcd_list(a)

print(p)
Buggy python submission (verdict: Time Limit Exceeded):
k,a,b=map(int,input().split())
cnt=1
yen=0

if b<a+2:
    print(k+1)

else:
    for i in range(k):
        if yen>0 :
            cnt+=b
            yen-=1
        elif cnt<a or i==k-1 :
            cnt+=1
        elif cnt>=a and i<=k-2 :
            cnt-=a
            yen+=1

    print(cnt)


Fixed submission:
k,a,b=map(int,input().split())
cnt=0
if b<a+2:
    print(k+1)
else:
    if k>=a+1:
        k-=a+1
        cnt+=b
        q,modulo=divmod(k,2)
        cnt+=q*b-q*a+modulo
        print(cnt)
    else:
        print(k+1)

Buggy python submission (verdict: Time Limit Exceeded):
k,a,b=map(int,input().split())
cnt=1
yen=0

if b<a+2:
    print(k+1)

else:
    for i in range(k):
        if yen>0 :
            cnt+=b
            yen-=1
        elif cnt<a or i==k-1 :
            cnt+=1
        elif cnt>=a and i<=k-2 :
            cnt-=a
            yen+=1

    print(cnt)


Fixed submission:
k,a,b=map(int,input().split())
cnt=0
if b<a+2:
    print(k+1)
else:
    if k>=a+1:
        k-=a+1
        cnt+=b
        q,modulo=divmod(k,2)
        cnt+=q*b-q*a+modulo
        print(cnt)
    else:
        print(k+1)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n,m=map(int,input().split())
x=list(map(int,input().split()))

arr=np.array(sorted(x))
dif=np.diff(arr)

lis=dif.tolist()
lis=sorted(lis,reverse=True)

if m>1:
    for i in range(n-1):
        lis.pop(0)

print(sum(lis))

Fixed submission:
import numpy as np
n,m=map(int,input().split())
x=list(map(int,input().split()))

arr=np.array(sorted(x))
dif=np.diff(arr)

lis=dif.tolist()
lis=sorted(lis,reverse=True)

for i in range(n-1):
    if len(lis)>0:
        lis.pop(0)

print(sum(lis))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])

Fixed submission:
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])

Buggy python submission (verdict: Runtime Error):
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N=int(input())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])

Fixed submission:
import sys
import itertools
if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    

N,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[float("inf") for _ in range(N)]
dp[0]=0
for i in range(N-1):
	for j in range(1,min(K+1,N-i)):
		dp[i+j] = min(dp[i+j],dp[i]+abs(h[i+j]-h[i]))
print(dp[N - 1])
Buggy python submission (verdict: Runtime Error):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=o
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=0
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)

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

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())

p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)

Fixed submission:
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
pay=0
p=[int(input()) for _ in range(N)]

for i in range(N):
	pay+=p[i]

print(pay-max(p)//2)