Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
N,K,Q=map(int,input().split())
A=[int(input()) for _ in range(Q)]
l = list(map(lambda x:'Yes' if K-Q+A.count(x)>0 else 'No',list(range(1,N+1))))
for i in l:
    print(i)

Fixed submission:
N, K, Q = map(int, input().split())
P = [0] * N

for i in range(Q):
    P[int(input())-1] += 1
for i in range(N):
    ans = K - Q + P[i]
    if ans > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
A=[int(input()) for _ in range(Q)]
l = list(map(lambda x:'Yes' if K-Q+A.count(x)>0 else 'No',list(range(1,N+1))))
for i in l:
    print(i)

Fixed submission:
N, K, Q = map(int, input().split())
P = [0] * N

for i in range(Q):
    P[int(input())-1] += 1
for i in range(N):
    ans = K - Q + P[i]
    if ans > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
A=[int(input()) for _ in range(Q)]
for i in range(1,N+1):
    if K-Q+A.count(i)>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
P = [0] * N

for i in range(Q):
    P[int(input())-1] += 1
for i in range(N):
    ans = K - Q + P[i]
    if ans > 0:
        print("Yes")
    else:
        print("No")

Buggy python submission (verdict: Time Limit Exceeded):
N,K,Q=map(int,input().split())
A=[int(input()) for _ in range(Q)]
for i in range(1,N+1):
    if K-Q+A.count(i)>0:
        print('Yes')
    else:
        print('No')

Fixed submission:
N, K, Q = map(int, input().split())
P = [0] * N

for i in range(Q):
    P[int(input())-1] += 1
for i in range(N):
    ans = K - Q + P[i]
    if ans > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
N=int(input())
P=list(range(1,N+1))
print(sum(P[0:N-1])+P[-1]%P[0])

Fixed submission:
N=int(input())
print(N*(N-1)//2)
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
s=["".join(sorted(input())) for _ in range(N)]
print(int(sum(list(map(lambda x: x*(x-1)/2*1, collections.Counter(s).values())))))

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

print(max(a+b,a-b,a*b))
Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
s=[str(collections.Counter(sorted(list(input())))) for _ in range(N)]

print(int(sum(list(map(lambda x: x*(x-1)/2*1, list(collections.Counter(s).values()))))))

Fixed submission:
import collections
N=int(input())
s=["".join(sorted(input())) for _ in range(N)]
print(int(sum(list(map(lambda x: x*(x-1)/2*1, collections.Counter(s).values())))))

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
s=[]
for _ in range(N):
    s.append(str(collections.Counter(sorted(list(input())))))

print(int(sum(list(map(lambda x: x*(x-1)/2*1, list(collections.Counter(s).values()))))))

Fixed submission:
import collections
N=int(input())
s=["".join(sorted(input())) for _ in range(N)]
print(int(sum(list(map(lambda x: x*(x-1)/2*1, collections.Counter(s).values())))))

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
s=[]
for _ in range(N):
    s.append(str(collections.Counter(sorted(list(input())))))

print(int(sum(list(map(lambda x: x*(x-1)/2*1, list(collections.Counter(s).values()))))))

Fixed submission:
import collections
N=int(input())
s=["".join(sorted(input())) for _ in range(N)]
print(int(sum(list(map(lambda x: x*(x-1)/2*1, collections.Counter(s).values())))))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input.split())
ans=(a+b)/2
if ans%2==0:
  print(ans//1)
else:
  print("IMPOSSIBLE")


Fixed submission:
a,b=map(int,input().split())
ans=(a+b)/2
if ans%1==0:
    print(int(ans//1))
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Time Limit Exceeded):
S=input()
MOD=10**9+7
dp=[0]*13
dp[0]=1
for s in S:
    p=[x for x in dp]
    dp=[0]*13
    if s=="?":
        a=range(10)
    else:
        a=[int(s)]
    for i in range(13):
        for x in a:
            dp[(10*i+x)%13]+=p[i]
    dp=[x%MOD for x in dp]
print(dp[5])

Fixed submission:
S=input()
MOD=10**9+7
dp=[0]*13
dp[0]=1
for s in S:
    p=[x for x in dp]
    dp=[0]*13
    if s=="?":
        a=range(10)
    else:
        a=[int(s)]
    for i in range(13):
        for x in a:
            dp[(10*i+x)%13]+=p[i]
    dp=[x%MOD for x in dp]
print(dp[5])
Buggy python submission (verdict: Runtime Error):
import functools
import operator
S=int(input())
prod = functools.partial(functools.reduce, operator.mul)
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
SS=factorize(S)
if len(SS)>1:
    print(0,0,prod(SS[1::2]),0,0,prod(SS[0::2]))
else:
    print(0,0,SS[0],0,0,1)

Fixed submission:
import math
S=int(input())
X1,Y1=0,0
X2=math.ceil(math.sqrt(S))
Y3=X2
Y2=1
X3=X2*Y3-S
print(X1,Y1,X2,Y2,X3,Y3)

Buggy python submission (verdict: Runtime Error):
import functools
import operator
S=int(input())
prod = functools.partial(functools.reduce, operator.mul)
def factorize(n):
    b = 2
    fct = []
    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b = b + 1
    if n > 1:
        fct.append(n)
    return fct
print(0,0,prod(factorize(S)[1::2]),0,0,prod(factorize(S)[0::2]))

Fixed submission:
import math
S=int(input())
X1,Y1=0,0
X2=math.ceil(math.sqrt(S))
Y3=X2
Y2=1
X3=X2*Y3-S
print(X1,Y1,X2,Y2,X3,Y3)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=[int(input()) for _ in range(N)]
for i in range(N):
    if sorted(A)[-1]==A[i]:
        print(sorted(A)[-2])
    else:
        print(sorted(A)[-1])

Fixed submission:
N=int(input())
A=[int(input()) for _ in range(N)]
AS=sorted(A)
# for i in range(N):
#     if AS[-1]==A[i]:
#         print(AS[-2])
#     else:
#         print(AS[-1])
for i in range(N):
    print(AS[-2] if AS[-1]==A[i] else AS[-1])

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
N=int(input())
A=[int(input()) for _ in range(N)]
Anp=np.array(A)
for i in range(N):
    vec=np.ones(N,dtype=bool)
    vec[i]=False
    print(max(Anp[vec]))

Fixed submission:
N=int(input())
A=[int(input()) for _ in range(N)]
AS=sorted(A)
# for i in range(N):
#     if AS[-1]==A[i]:
#         print(AS[-2])
#     else:
#         print(AS[-1])
for i in range(N):
    print(AS[-2] if AS[-1]==A[i] else AS[-1])
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
if all(map(lambda x:x==0,A)) or (sum(map(lambda x:x==0,A))==(N/3) and (len(set(A))==2) or (len(set(A))==3) and list(set(A))[0]^list(set(A))[1]^list(set(A))[2]==0 and A.count(list(set(A))[0])==A.count(list(set(A))[1]) and A.count(list(set(A))[1])==A.count(list(set(A))[2]) and A.count(list(set(A))[3])==A.count(list(set(A))[0])):
    print("Yes")
else:
    print("No")

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
for i in A:
    a^=i
print(["No","Yes"][a==1])

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
a=1;for i in A:a^=i 
print(["No","Yes"][a==1])

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
for i in A:
    a^=i
print(["No","Yes"][a==1])

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
def binbin(a):
    return int(bin(a).split("b")[1])
arr=[A[-1]]
arr.extend(A)
arr.append(A[0])
ans=[]
for i in range(1,N+1):
    ans.append(int(binbin(arr[i])) == int("".join(list(map(lambda x:str(int(x)%2),str(binbin(arr[i-1])+binbin(arr[i+1])))))))

if all(ans):
    if any(ans)==False:
        print("Yes")
else:
    if any(ans)==False:
    print("No")

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
for i in A:
    a^=i
print(["No","Yes"][a==1])

Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))

arr=[A[-1]]
arr.extend(A)
arr.append(A[0])
ans=[]
for i in range(1,N+1):
    ans.append(int(binbin(arr[i])) == int("".join(list(map(lambda x:str(int(x)%2),str(binbin(arr[i-1])+binbin(arr[i+1])))))))

print("Yes" if all(ans) else "No")

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
a=1
for i in A:
    a^=i
print(["No","Yes"][a==1])
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())
CC = B // C - A // C + (A % C == 0)
DD = B // D - A // D + (A % D == 0)
import math
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
E = lcm(C, D)
EE = B // E - A // E + (A % E == 0)
print(B - A + 1 - CC - DD + EE)

Fixed submission:
A, B, C, D = map(int, input().split())
CC = B // C - A // C + (A % C == 0)
DD = B // D - A // D + (A % D == 0)
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a
def lcm(a, b):
    return a * b // gcd (a, b)
E = lcm(C, D)
EE = B // E - A // E + (A % E == 0)
print(B - A + 1 - CC - DD + EE)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
a = []
for _ in range(M):
    a.append(int(input()))

arr=[0]*N

if 1 in a:
    arr[0]=0
else:
    arr[0]=1

if 2 in a:
    arr[1]=0
else:
    arr[1]=1+arr[0]
    
for i in range(2,N):
    if i+1 in a:
        arr[i]=0
    else:
        arr[i]=arr[i-1]+arr[i-2]

print(arr[-1]%(10**9+7))

Fixed submission:
MOD=10**9+7
N,M=map(int,input().split())
dp=[0]*(N+1)
dp[0]=1
A=set(int(input()) for _ in range(M))
for i in range(1,N+1):
    if i in A:
        continue
    x=dp[i-1]
    if i>1:
        x+=dp[i-2]
    dp[i]=x%MOD
print(dp[N])
Buggy python submission (verdict: Runtime Error):
ans = 0
n,m = map(int, input().split())
s_list = []
s_count_list = []
for _ in range(m):
    s = list(map(int,input().split()))
    s_count_list.append(s[0])
    s_list.append(s[1:])
oe = list(map(int,input().split()))   
seq = list(range(1, n+1))
for i in range(1, n+1):
    cmb = list(itertools.combinations(seq,i))
    for j in range(len(cmb)):
        ansv = []
        for k in range(m):
            ss = []
            for l in range(len(s_list[k])):
                if s_list[k][l] in list(cmb[j]):
                    ss.append(s_list[k][l])
            if len(ss)%2 == oe[k]:
                ansv.append(True)
            else:
                ansv.append(False)
        if all(ansv):
            ans += 1
print(ans)

Fixed submission:
n,m=map(int,input().split())
s=[]
for _ in range(m):
    s.append(list(map(int,input().split()))[1:])
p=list(map(int,input().split()))

import itertools

cnt=0
for i in itertools.product([0,1],repeat=n):
    tn_arr=[]
    for j in range(m):
        on_cnt=0
        for k in range(len(s[j])):
            on_cnt+=i[s[j][k]-1]
        if on_cnt%2==p[j]:
            tn_arr.append(True)
        else:
            tn_arr.append(False)
    if all(tn_arr):
        cnt+=1

print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

for _ in range(Q):
    l=list(map(int,input().split()))
    print(sum(t[l[0]:l[1]]))

Fixed submission:
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

import numpy
res = numpy.cumsum(t)

for _ in range(Q):
    l=list(map(int,input().split()))
    print(res[l[1]-1]-res[l[0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()

l=[]
for _ in range(Q):
    l.append(list(map(int,input().split())))

t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

for j in range(len(l)):
    print(sum(t[l[j][0]:l[j][1]]))

Fixed submission:
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

import numpy
res = numpy.cumsum(t)

for _ in range(Q):
    l=list(map(int,input().split()))
    print(res[l[1]-1]-res[l[0]-1])

Buggy python submission (verdict: Runtime Error):
N,Q=map(int,input().split())
S=input()

l=[]
for _ in range(Q):
    l.append(list(map(int,input().split())))

t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

for j in range(len(t)):
    print(sum(t[l[j][0]:l[j][1]]))

Fixed submission:
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

import numpy
res = numpy.cumsum(t)

for _ in range(Q):
    l=list(map(int,input().split()))
    print(res[l[1]-1]-res[l[0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
l=[]
for _ in range(Q):
    l=list(map(int,input().split()))
    print(S[(l[0]-1):l[1]].count('AC'))

Fixed submission:
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

import numpy
res = numpy.cumsum(t)

for _ in range(Q):
    l=list(map(int,input().split()))
    print(res[l[1]-1]-res[l[0]-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
l=[]
for _ in range(Q):
    l=list(map(int,input().split()))
    print(S[(l[0]-1):l[1]].count('AC'))

Fixed submission:
N,Q=map(int,input().split())
S=input()
t = [0]*(N+1)
for i in range(len(S)-1):
    if S[i] == 'A' and S[i+1] == 'C':
        t[i+1] = 1

import numpy
res = numpy.cumsum(t)

for _ in range(Q):
    l=list(map(int,input().split()))
    print(res[l[1]-1]-res[l[0]-1])
Buggy python submission (verdict: Time Limit Exceeded):
s=input()

s_len_init = len(s) 
while(1):
    s_len = len(s)
    s = s.replace('01','')
    if s_len == len(s):
        break
    else:
        continue
while(1):
    s_len = len(s)
    s = s.replace('10','')
    if s_len == len(s):
        break
    else:
        continue
print(s_len_init-len(s))

Fixed submission:
s = input()
print(len(s) - abs(s.count('1') - s.count('0')))

Buggy python submission (verdict: Time Limit Exceeded):
s=input()

s_len_init = len(s) 
while(1):
    s_len = len(s)
    s = s.replace('01','')
    if s_len == len(s):
        break
    else:
        continue
while(1):
    s_len = len(s)
    s = s.replace('10','')
    if s_len == len(s):
        break
    else:
        continue
print(s_len_init-len(s))

Fixed submission:
s = input()
print(len(s) - abs(s.count('1') - s.count('0')))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=sorted(list(map(int,input().split())))
ans=10**7
m=a[-1]
for i in range(len(a)-1):
    t=m%(a[i+1]-a[i])
    s=a[i+1]%a[i]
    if t!=0:
        ans=min(ans,t)
    if s!=0:
        ans=min(ans,s)
print(ans)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return a
ans=10**10
for i,j in zip(a,a[1:]):
    ans=min(ans,gcd(i,j))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

n,m=map(int,input().split())
x=list(map(int,input().split()))
n = min(n,len(x))

xs=sorted(x)
# xs

# def sabun(x,i):
#     return x[i+1]-x[i]

def sabun(x):
    a=np.array(x)
    return list(a[1:]-a[:-1])

# sabunx=[sabun(xs,i) for i in range(m-1)]

sabunx=sabun(xs)
# sabunx

for _ in range(n-1):
    sabunx.remove(sabunx[sabunx.index(sorted(sabunx,reverse=True)[0])])
#     print(sabunx)
    
print(sum(sabunx))

Fixed submission:
import numpy as np

n,m=map(int,input().split())
x=list(map(int,input().split()))
n = min(n,len(x))

xs=sorted(x)
# xs

# def sabun(x,i):
#     return x[i+1]-x[i]

def sabun(x):
    a=np.array(x)
    return list(a[1:]-a[:-1])

# sabunx=[sabun(xs,i) for i in range(m-1)]

sabunx=sabun(xs)
# sabunx

print(sum(sorted(sabunx,reverse=True)[n-1:]))

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
x=list(map(int,input().split()))
n = min(n,len(x))

xs=sorted(x)
# xs

def sabun(x,i):
    return x[i+1]-x[i]

sabunx=[sabun(xs,i) for i in range(m-1)]
# sabunx

for _ in range(n-1):
    sabunx.remove(sabunx[sabunx.index(sorted(sabunx,reverse=True)[0])])
#     print(sabunx)
    
print(sum(sabunx))

Fixed submission:
import numpy as np

n,m=map(int,input().split())
x=list(map(int,input().split()))
n = min(n,len(x))

xs=sorted(x)
# xs

# def sabun(x,i):
#     return x[i+1]-x[i]

def sabun(x):
    a=np.array(x)
    return list(a[1:]-a[:-1])

# sabunx=[sabun(xs,i) for i in range(m-1)]

sabunx=sabun(xs)
# sabunx

print(sum(sorted(sabunx,reverse=True)[n-1:]))
Buggy python submission (verdict: Runtime Error):
N = int(input())
h = list(map(int, input().split()))

def chmin(a,b):
    if a > b:
        return b
    else:
        return a

dp[0] = 0

for i in range(1,N):
    dp[i] = chmin(dp[i], dp[i-i] + abs(h[i] - h[i-1]))
    if i > 1:
        dp[i] = chmin(dp[i], dp[i-2] + abs(h[i] - h[i-2]))

print(dp[N-1])

Fixed submission:
N = int(input())
a = list(map(int,input().split()))
dp = [0,abs(a[0]-a[1])]
for i in range(2,N):
    dp.append(min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2])))
print(dp[N-1])
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
H=list(map(int,input().split()))
dp = [float("inf")]*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[-1])

Fixed submission:
N,K=map(int,input().split())
H=list(map(int,input().split()))
dp = [float("inf")]*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[-1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
cnt = 0
for i in range(0, N):
    if int(input()) != 1:
        cnt = cnt + 1

if N % 2 == 0:
    if cnt % 2 == 0:
        print('second')
    else:
        print('first')
else:
    if cnt % 2 == 0:
        print('first')
    else:
        print('second')

Fixed submission:
N = str(input())

ans = 0
for i in range(0, 4):
    if N[i] == '2':
        ans = ans + 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(0, N):
    if int(input())% 2 == 0:
        cnt = cnt + 1
if cnt % 2 == 0:
    print('first')
else:
    print('second')

Fixed submission:
N = int(input())
cnt = 0
for i in range(0, N):
    if int(input()) % 2 == 1:
        cnt = cnt + 1

if cnt > 0:
    print('first')
else:
    print('second')

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

Alist = []
for i in range(0, N):
    Alist.append(int(input()))

for j in range(0, len(Alist)):
    if Alist[j] % 2 == 0:
        cnt = cnt + 1
if cnt % 2 == 0:
    print('second')
else:
    print('first')

Fixed submission:
N = int(input())
cnt = 0
for i in range(0, N):
    if int(input()) % 2 == 1:
        cnt = cnt + 1

if cnt > 0:
    print('first')
else:
    print('second')
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
hlist = []
for i in range(N):
    hlist.append(int(input()))

import numpy as np
dlist = np.diff(np.sort(hlist))

ans = []
for i in range(len(dlist)-1):
    ans.append(sum(dlist[i:i+K-1]))
print(min(ans))

Fixed submission:
N, K = map(int, input().split())
hlist = []
for i in range(N):
    hlist.append(int(input()))

import numpy as np
hlist = np.sort(hlist)

ans = 10**10
for i in range(N-K+1):
    ans = min(ans, hlist[i+K-1]-hlist[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
4 3
1 1000
2 4
3 1000
4 500

Fixed submission:
N, T = map(int,input().split())

clist = []
for i in range(N):
    c, t = map(int,input().split())
    if t <= T:
        clist.append(c)
if len(clist) > 0:
    print(min(clist))
else:
    print("TLE")

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

clist = []
for i in range(N):
    c, t = map(int,input().split())
    if t <= T:
        clist.append(c)
print(min(clist))

Fixed submission:
N, T = map(int,input().split())

clist = []
for i in range(N):
    c, t = map(int,input().split())
    if t <= T:
        clist.append(c)
if len(clist) > 0:
    print(min(clist))
else:
    print("TLE")
Buggy python submission (verdict: Runtime Error):
x=sorted(input())
print(int(''.join(x[:-3:-1]))+int(x[0]))

Fixed submission:
x=sorted(input().replace(' ',''))
print(int(''.join(x[:-3:-1]))+int(x[0]))
Buggy python submission (verdict: Runtime Error):
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
print('No War' if max(*x,X)<=min(*y,Y) else 'War')

Fixed submission:
N,M,X,Y=map(int,input().split())
x=list(map(int,input().split()))
y=list(map(int,input().split()))

print('No War' if min(min(y),Y)>max(max(x),X) else 'War')
Buggy python submission (verdict: Runtime Error):
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

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

if A % 2 != 0 and B % 2 !=0:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x=list(map(lambda t:t-min(x),x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x=list(map(lambda t:t-min(x),x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
x_list.append(X)
def gcd_1(l):
    x = max(l)
    y = min(l)
    if x % y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z
        
if N == 1:
    print(x_list[0] - X)
    exit()

values = np.sort(np.array(x_list))[1:] - min(x_list)

if N == 2:
    print(values[0])
    exit()

print(gcd_1(values))



Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

def gcd(l):
    x = max(l)
    y = min(l)
    if x % y == 0:
        return y
    else:
        while x%y!=0:
            z = x%y
            x = y
            y = z
        else:
            return z
        
if N == 1:
    print(x_list[0] - X)
    exit()

values = np.sort(np.array(x_list))[1:] - min(x_list)
print(gcd(values))



Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import functools
import math

N, X = map(int, input().split())
x_list = list(map(int, input().split()))

if N == 1:
    print(x_list[0] - X)
    exit()

values = np.sort(np.array(x_list))[1:] - min(x_list)
gcd = functools.reduce(math.gcd, values)
print(gcd)

Fixed submission:
N,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
mx=min(x)
x=list(map(lambda t:t-mx,x))
def gcd(a,b):
    while b:
        a,b=b,a%b
    return(a)
a=10**10
for i,j in zip(x,x[1:]):
    a=min(a,gcd(i,j))
print(a)