Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
    	print(k[-1])
	if i==k[-1]:
		print(k[-2])

Fixed submission:
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
		print(k[-1])
	if i==k[-1]:
		print(k[-2])

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
l=[int(input()) for _ in range(n)]


k=sorted(l)
dic_lst={}
for i in l:
  if i not in dic_lst:
    dic_lst[i]=1
  else:
    dic_lst[i]+=1
for i in l:
  max_num=max(dic_lst.keys())
  if i<max_num:
    print(max_num)
  if i==max_num:
    if dic_lst[i]>1:
      print(max_num)
    elif dic_lst[i]==1:
      print(k[-2])


Fixed submission:
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
		print(k[-1])
	if i==k[-1]:
		print(k[-2])

Buggy python submission (verdict: Time Limit Exceeded):
import copy
n=int(input())
l=[int(input()) for _ in range(n)]

k=copy.copy(l)
k.sort()
dic_lst={}
for i in l:
  if i not in dic_lst:
    dic_lst[i]=1
  else:
    dic_lst[i]+=1
for i in l:
  max_num=max(dic_lst.keys())
  if i<max_num:
    print(max_num)
  if i==max_num:
    if dic_lst[i]>1:
      print(max_num)
    elif dic_lst[i]==1:
      print(k[-2])


Fixed submission:
n=int(input())
l=[int(input()) for _ in range(n)]
k=sorted(l)

for i in l:
	if i<k[-1]:
		print(k[-1])
	if i==k[-1]:
		print(k[-2])
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=sort(list(map(int,input().split())))
print(l[n//2]-l[n//2-1])

Fixed submission:
n=int(input())
l=sorted(list(map(int,input().split())))
print(l[n//2]-l[n//2-1])
Buggy python submission (verdict: Runtime Error):
a=list(input())
for i in range(len(a)-1):
	if a[i]==a[i+1]:
		print("Good")
        break
else:print("Bad")


Fixed submission:
a=list(input())
for i in range(len(a)-1):
	if a[i]==a[i+1]:
		print("Bad")
		break
else:print("Good")
Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
lst_kazu=[i for i in range(1,n+1)]
lst_aji=[i-l+1 for i in range(1,n+1)]
lst_aji_sum=sum(lst_aji)
aji_ans=0
for i in range(n):
	if lst_aji[i]==int(lst_aji_sum/n):
    	aji_ans=(lst_aji_sum-lst_aji[i])
        break
    else:
      	aji_ans=min(aji_ans,abs(lst_aji[i]-(lst_aji_sum-lst_aji[i])/n))
print(aji_ans)

Fixed submission:
n , l = map ( int , input ( ).split ( ) ) 
lst = [i + l - 1 for i in range ( 1 , n + 1 )]
ans=1000000 
sum1=sum(lst) 
for i in lst: 
	if abs(i)<abs(ans): 
		ans=i
print(sum1-ans)

Buggy python submission (verdict: Runtime Error):
n,l=map(int,input().split())
lst_kazu=[i for i in range(1,n+1)]
lst_aji=[i-l+1 for i in range(1,n+1)]
lst_aji_sum=sum(lst_aji)
aji_ans=0
for i in range(n):
	if lst_aji[i]==int(lst_aji_sum/n):
    	print(lst_aji_sum-lst_aji[i])
        break
    else:
      	aji_ans=min(aji_ans,ans(lst_aji[i]-int(lst_aji_sum/n)))
print(aji_ans)

Fixed submission:
n , l = map ( int , input ( ).split ( ) ) 
lst = [i + l - 1 for i in range ( 1 , n + 1 )]
ans=1000000 
sum1=sum(lst) 
for i in lst: 
	if abs(i)<abs(ans): 
		ans=i
print(sum1-ans)
Buggy python submission (verdict: Runtime Error):
n,k=int(input())
s=input()
print(s[0:k-1]+s[k-1:k]+s[k:])

Fixed submission:
n,k=map(int,input().split()) 
s=input() 
print(s[0:k-1]+s[k-1:k].lower()+s[k:])
Buggy python submission (verdict: Runtime Error):
x=input()
a=x[:2]
b=x[2:]
ans_lst=[]
for y in [a,b]:
	if "00"<y<"13":
  		ans_lst.append(True)
    else:ans_lst.append(False)
if all(ans_lst):
    print("AMBIGUOUS")
elif not any(ans_lst):
    print("NA")
elif ans_lst[0] and ans_lst[1]==False:
	print("MMYY")
elif ans_lst[0]==False and ans_lst[1]:
	print("YYMM")

Fixed submission:
x=input()
a=x[:2]
b=x[2:]
ans_lst=[]
for y in [a,b]:
	if "00"<y<"13":
		ans_lst.append(True)
	else:ans_lst.append(False)
if all(ans_lst):
    print("AMBIGUOUS")
elif not any(ans_lst):
    print("NA")
elif ans_lst[0] and ans_lst[1]==False:
	print("MMYY")
elif ans_lst[0]==False and ans_lst[1]:
	print("YYMM")
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
print(a-b+1)

Fixed submission:
a,b=map(int,input().split())
print(a-b+1)
Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
cnt=0
for i in range(n+1):
    for j in range(n+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)

Fixed submission:
r,g,b,n=map(int,input().split())
cnt=0
for i in range(int(n//r)+1):
    for j in range(int(n//g)+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
r,g,b,n=map(int,input().split())
cnt=0
for i in range(int(n//r)+1):
    for j in range(int(n//g)+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)

Fixed submission:
r,g,b,n=map(int,input().split())
cnt=0
for i in range(int(n//r)+1):
    for j in range(int(n//g)+1):
        if (n-i*r-j*g) %b ==0 and 0<=(n-i*r-j*g) // b <= 3000:
            # print(i,j,(n-i*r-j*g)//3)
            cnt+=1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque

H, W = map(int, input().split())
grid = [input() for i in range(H)]

# 初期の黒('#')の位置からの距離
dist = [[-1]*W for _ in range(H)]

# '#'の位置をキューに追加（＝今回はこれが複数あるので、複数スタートとなる）
black_cells = deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == '#':
            black_cells.append((h, w))
            dist[h][w] = 0

def bfs(black_cells, dist):
    """
    BFSを用いて、全マス目を黒くする回数を求める

    Args:
        black_cells: 「開始時の黒マス」の座標が入ったキュー（複数座標あり）
        dist: 「開始時の黒マス」からの距離の入ったリスト  [[-1, -1, 0], ...]
        　　　（白マスの初期値は0）

    Returns:
        g: 操作を繰り返した数
    """
    d = 0
    while black_cells:
        # キューとして使うのでpop()ではなくpopleft()
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:  # セルが白('.')であるのと同義
                dist[new_h][new_w] = d+1
                black_cells.append((new_h, new_w))
    return d

d = bfs(black_cells, dist)
print(d)

Fixed submission:
from collections import deque

H, W = map(int, input().split())
grid = [input() for i in range(H)]

# 初期の黒('#')の位置からの距離
dist = [[-1]*W for _ in range(H)]

# '#'の位置をキューに追加（＝今回はこれが複数あるので、複数スタートとなる）
black_cells = deque()
for h in range(H):
    for w in range(W):
        if grid[h][w] == '#':
            black_cells.append((h, w))
            dist[h][w] = 0

def bfs(black_cells, dist):
    """
    BFSを用いて、全マス目を黒くする回数を求める

    Args:
        black_cells: 「開始時の黒マス」の座標が入ったキュー（複数座標あり）
        dist: 「開始時の黒マス」からの距離の入ったリスト  [[-1, -1, 0], ...]
        　　　（白マスの初期値は0）

    Returns:
        g: 操作を繰り返した数
    """
    d = 0
    while black_cells:
        # キューとして使うのでpop()ではなくpopleft()
        h, w = black_cells.popleft()
        d = dist[h][w]
        for dy, dx in ((1, 0), (0, 1), (-1, 0), (0, -1)):
            new_h = h + dy
            new_w = w + dx
            if new_h < 0 or H <= new_h or new_w < 0 or W <= new_w:
                continue
            if dist[new_h][new_w] == -1:  # セルが白('.')であるのと同義
                dist[new_h][new_w] = d+1
                black_cells.append((new_h, new_w))
    return d

d = bfs(black_cells, dist)
print(d)
Buggy python submission (verdict: Runtime Error):
A , B, T =map,int,(input().split())
print((T // A)*B)

Fixed submission:
A , B, T =map(int,input().split())
print((T // A)*B)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
print(max(max(x,y)*2-1,x*2)

Fixed submission:
x,y=map(int,input().split())
if x!=y:
  print(max(x,y)*2-1)
else:
  print(x*2)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
max_value=-999
cnt=0
for i in range(n):
  if max_value<=l[i]:
    max_value=max(max_balue,l[i])
    cnt+=1
print(cnt)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n-1):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
max_value=-999
cnt=0
for i in range(n):
  if max_balue<l[i]:
    cnt+=1
print(cnt)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n-1):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
cnt=1
max_h=-1
for i in range(n-1):
  max_h=max(l[i],max_h)
  if l[i+1]>=max_h:
    cnt+=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
l=list(int(input()) for _ in range(5))
m=int(input())
cnt=0
for i in range(5):
  if l[i+1]-l[i]<=m:
    cnt+=1
print([":(","Yay!"][cnt==5])

Fixed submission:
l=list(int(input()) for _ in range(5))
m=int(input())
print([":(","Yay!"][l[4]-l[0]<=m])
Buggy python submission (verdict: Runtime Error):
l=[input() for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)

Fixed submission:
l=[int(input()) for _ in range(5)]
l_1=[]
for i in l:
  if i%10!=0:
    l_1.append(((i+9)//10)*10)
  else:l_1.append(i)
nnn=9999999    
for i in range(5):
  num_1=0
  for j in range(5):
    if i==j:
      num_1+=l[j]
    else:num_1+=l_1[j]
  nnn=min(nnn,num_1)
print(nnn)
Buggy python submission (verdict: Runtime Error):
n= input()
ans,temp = 0,0
for x in S:
    if x in 'ACGT':
        temp += 1
    else:
        temp = 0
    ans = max(ans,temp)
print(ans)

Fixed submission:
s=input()
ans=0
cnt=0
for i in s:
    if i in ["A","G","C","T"]:
        cnt+=1
        ans=max(ans,cnt)
    else: cnt=0
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split()) 
q=input() 
l=[list(map(int,input().split())) for _ in range(m)] 
for j in range(m): 
	cnt=0 
	for i in range(l[j][0],l[j][1]): 
		if (q[i-1]+q[i])=="AC": 
			cnt+=1 
	print(cnt) 

Fixed submission:
n,m=map(int,input().split()) 
q=input() 
l=[list(map(int,input().split())) for _ in range(m)] 
ans=0 
lst_j=[0]*(n+1) 
for i in range(n-1): 
	cnt=0 
	if q[i]+q[i+1]=="AC": 
		cnt=1 
		lst_j[i+1]=cnt+lst_j[i] 
	else:lst_j[i+1]=lst_j[i] 
for i,j in l: 
	ans=lst_j[j-1]-lst_j[i-1] 
	print(ans)
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
using namespace std;

int main(){
    int a,b,c;
    const int CO=100;
    vector<int> vb;

    cin>>a>>b>>c;
    for (int i=1;i<CO+1;i++){
        if (a %i==0 && b % i==0){
        vb.push_back(i);
        }
    }
    reverse(vb.begin(),vb.end());
    cout<<vb[c-1]<<endl;
    return 0;
}

Fixed submission:
a,b,c=map(int,input().split())
lst=[]
for i in range(1,101):
  if a %i==0 and b % i ==0:
    lst.append(i)
print(sorted(lst,reverse=True)[c-1])
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
#include <numeric>
using namespace std;

int main(){
    int n;
    int max_s=0;
    int sum_s=0;
    int L;

    cin>>n;
    for (int i=0;i<n;i++){
        cin>>L;
        sum_s+=L;
        max_s=max(max_s,L);
    }  	
	if (max_s<sum_s-max_s){
    cout<<"Yes"<<endl;
    }else{
    cout<<"No"<<endl;
    }
    return 0;
}


Fixed submission:
n=int(input())
l=sorted(map(int,input().split()))
print(["No","Yes"][l[-1]<sum(l)-l[-1]])

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=sort(map(int,input().split()))
print(["No","Yes"][l[-1]>=sum(l)-l[-1]])

Fixed submission:
n=int(input())
l=sorted(map(int,input().split()))
print(["No","Yes"][l[-1]<sum(l)-l[-1]])
Buggy python submission (verdict: Runtime Error):
x,y,_=map(int(input().split()))
print(x*y//2)

Fixed submission:
x,y,_=map(int,input().split())
print(x*y//2)
Buggy python submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP[-1])

Fixed submission:
n = int(input())
aaa = list(map(int,input().split()))

def hantei(n,aaa):
	dp = [0]*(n+1)
	dp[0] = 0
	dp[1] = abs(aaa[1]-aaa[0])
	for i in range(n-2):
		dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
	return dp[n-1]

print(hantei(n,aaa))

Buggy python submission (verdict: Runtime Error):
H,K=map(int,input().split())
lst_0=list(map(int,input().split()))
DP=[float("INF")]*H
DP[0]=0
lst_2=[]
for i in range(1,H):
    lst_1=[]
    for j in range(1,K+1):
        if i - j >= 0:
            DP[i]=abs(lst_0[i]-lst_0[i-j])+DP[i-j]
            lst_1.append(DP[i])
    DP[i]=min(lst_1)
print(DP,DP[-1])

Fixed submission:
n = int(input())
aaa = list(map(int,input().split()))

def hantei(n,aaa):
	dp = [0]*(n+1)
	dp[0] = 0
	dp[1] = abs(aaa[1]-aaa[0])
	for i in range(n-2):
		dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
	return dp[n-1]

print(hantei(n,aaa))

Buggy python submission (verdict: Runtime Error):
n = int(input())
aaa = list(map(int,input().split()))
def hantei(n,aaa):
    dp = [0]*(n+1)
    dp[0] = 0
    dp[1] = abs(aaa[1]-aaa[0])
    for i in range(n-2):
        dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
    return dp[n-1]
hantei(n)

Fixed submission:
n = int(input())
aaa = list(map(int,input().split()))

def hantei(n,aaa):
	dp = [0]*(n+1)
	dp[0] = 0
	dp[1] = abs(aaa[1]-aaa[0])
	for i in range(n-2):
		dp[i+2] = min(dp[i+1]+abs(aaa[i+2]-aaa[i+1]),dp[i]+abs(aaa[i+2]-aaa[i]))
	return dp[n-1]

print(hantei(n,aaa))
Buggy python submission (verdict: Runtime Error):
n,k=map(int,input().split())
lst=[int(input()) for _ in range(n)]
lst=sorted(lst)
ab=lst[k-1]-lst[0]
cd=lst[-1]-lst[-k]
print(ans=min(ab,cd))

Fixed submission:
n,k=map(int,input().split())
lst=[int(input()) for _ in range(n)]
lst=sorted(lst)
ans=float("inf")
for i in range(n+1-k):
  ans=min(ans,lst[k-1+i]-lst[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
print(["NO","YES"][n==7 or n==5 orn==3])

Fixed submission:
n=int(input())
print(["NO","YES"][n==7 or n==5 or n==3])
Buggy python submission (verdict: Runtime Error):
n=input()
a=0
b=753
ans=100000000
for i in renge(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
	ans=min(abs(a-b),ans)
print(ans)

Fixed submission:
n=input()
a=0
b=753
ans=100000000
for i in range(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
	ans=min(abs(a-b),ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
n=input()
a=0
b=753
ans=100000000
for i in renge(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
    ans=min(abs(a-b),ans)
print(ans)

Fixed submission:
n=input()
a=0
b=753
ans=100000000
for i in range(len(n)-2):
	a=int(n[i])*100+int(n[i+1])*10+int(n[i+2])
	ans=min(abs(a-b),ans)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n=1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)

Fixed submission:
n=int(input())
if n==1:
  print("Hello World")
else:
  A=int(input())
  B=int(input())
  print(A+B)
Buggy python submission (verdict: Runtime Error):
3 2 10 20
8 15 13
16 22
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
	if x1<i<=x2:
  		print("No War")
        break
	else:print("War")
print(n,m,x,y,x1,x2)

Fixed submission:
n,m,x,y=map(int,input().split())
x1=max(map(int,input().split()))
x2=min(map(int,input().split()))
z=list(range(x+1,y+1))
for i in z:
	if x1<i<=x2:
		print("No War")
		break
else:
	print("War")
Buggy python submission (verdict: Runtime Error):
l=input()
m=input()
ll=set(l)-sei(m)
lll=set(m)-set(l)
print(["No","Yes"][len(ll)==len(lll)])

Fixed submission:
a=input()
b=input()
dic_a={}
dic_b={}
for i in a:
    if i not in dic_a:
        dic_a[i]=1
    else:
        dic_a[i] += 1
for i in b:
    if i not in dic_b:
        dic_b[i]=1
    else:
        dic_b[i] += 1


print("Yes" if (sorted(dic_a.values())==sorted(dic_b.values())) else "No" )
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=false
for i in range(1,4):
  if a*b*c %2 ==1: 
    ans=True
    break    
if ans;print("Yes")
else:print("No")

Fixed submission:
a,b=map(int,input().split())
ans=False
for i in range(1,4):
  if a*b*i %2 ==1: 
    ans=True
    break    
if ans:print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))


Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))


Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

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

print(gcd(*new_lst))

Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

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

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))

Fixed submission:
import fractions
from functools import reduce

n,x = map(int,input().split())
lst=list(map(int,input().split()))
new_lst=[abs(i-x) for i in lst]

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

print(gcd(*new_lst))
Buggy python submission (verdict: Runtime Error):
#include<iostream>
#include<algorithm>
#include <vector>
#include <cmath>
#include<string>
#define REP(i,n) for(int i=0;i<int (n);i++)
using namespace std;

int main(){
    int n;
    int ans=1;
    cin>>n;
    if (n<105){
        cout<<0<<endl;
        return 0;
    }
    for (int i=106;i<=n;i++){
        int cnt=0;
        for (int j=1;j<=i;j++){
            
            if (i %j ==0){
                cnt++;
            } 
        }
        if (cnt==8) ans++;
    }
    cout<<ans<<endl; 
    
    return 0;
}

Fixed submission:
def I(): return int(input())
n = I()
ans = 0
if n>=105:
    for i in range(105,n+1,2):
        cnt=0
        for j in range(1,int(i**0.5)+1):
            if i % j ==0:
                if j*j==i:
                    cnt+=1
                else:
                    cnt+=2
        if cnt==8:
            ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
n=int(input())
m=int(n**0.5)+1
con_num=0
for i in range(m):
  if n%i==0:
    con_num+=1
if con_num==8 and n%2==1:
  print("1")
else:
  print("0")

Fixed submission:
def I(): return int(input())
n = I()
ans = 0
if n>=105:
    for i in range(105,n+1,2):
        cnt=0
        for j in range(1,int(i**0.5)+1):
            if i % j ==0:
                if j*j==i:
                    cnt+=1
                else:
                    cnt+=2
        if cnt==8:
            ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
l=list(map(int,input().split()) 
dd=[]                                                                  
for i in l: 
	if i % 2==0: 
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst)) 

Fixed submission:
n=int(input())
l=list(map(int,input().split()))
dd=[]                                                                  
for i in l: 
	if i % 2==0:
		dd.append(i)       
cnt_lst=[]                                                             
for i in dd: 
	cnt1=0 
	while(i % 2==0): 
		i//= 2 
		cnt1+=1 
		if i %2==1: 
			cnt=cnt1 
			cnt_lst.append(cnt)             
			break 
print(sum(cnt_lst))
Buggy python submission (verdict: Runtime Error):
print(["ABD","ABC][len(input())==3])

Fixed submission:
print(["ABC","ABD"][len(input())==4])
Buggy python submission (verdict: Runtime Error):
a,b=mac(int,input().split())
if a<=b:print(a)
else: print(a-1)

Fixed submission:
a,b=map(int,input().split())
if a<=b:print(a)
else: print(a-1)
Buggy python submission (verdict: Runtime Error):
a,b,=map(int,input().split()) 
k=int(input()) 
print((max([a,b,c]))*(2**k-1)+sum([a,b,c])) 


Fixed submission:
a,b,c=map(int,input().split())
k=int(input())
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
k=int(input())
print((max(a,b,c))*2*k+sum(a,b,c))

Fixed submission:
a,b,c=map(int,input().split())
k=int(input())
print((max([a,b,c]))*(2**k-1)+sum([a,b,c]))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sorted(set(l+m))
print(*ans)

Fixed submission:
a,b,c=map(int,input().split()) 
l=list(range(a,b+1)[0:c]) 
m=list(range(b,a-1,-1)[0:c]) 
ans=sorted(set(l+m)) 
print(*ans)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sort(set(l+m))
print(*ans)

Fixed submission:
a,b,c=map(int,input().split()) 
l=list(range(a,b+1)[0:c]) 
m=list(range(b,a-1,-1)[0:c]) 
ans=sorted(set(l+m)) 
print(*ans)

Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
l=list(range(a,a+c))
m=list(range(b,a-1,-1))
ans=sort(set(l+M))
print(ans)

Fixed submission:
a,b,c=map(int,input().split()) 
l=list(range(a,b+1)[0:c]) 
m=list(range(b,a-1,-1)[0:c]) 
ans=sorted(set(l+m)) 
print(*ans)
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
print("Yes"a+b>=c else"No")

Fixed submission:
a,b,c=map(int,input().split())
print("Yes"if a+b>=c else"No")