Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=list(map(int,input().split()))
Y=list(map(int,input().split()))
XX=[abs(Y[i]-n[1]) for i in range(n[0])]
X=sorted(XX)
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) 
for i in range(n[0]-1):
    X[0]=gcd(X[0],X[1])
    X=[X[0]]+X[2:]
print(max(X))

Fixed submission:
n=list(map(int,input().split()))
Y=list(map(int,input().split()))
XX=[abs(Y[i]-n[1]) for i in range(n[0])]
X=sorted(XX)
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) 
ans=X[0]
for i in range(n[0]-1):
    ans=gcd(ans,X[i])
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n=list(map(int,input().split()))
Y=list(map(int,input().split()))
X=[abs(Y[i]-n[1]) for i in range(n[0])]
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) 
for i in range(n[0]-1):
    X[0]=gcd(X[0],X[1])
    X=[X[0]]+X[2:]
print(max(X))

Fixed submission:
n=list(map(int,input().split()))
Y=list(map(int,input().split()))
XX=[abs(Y[i]-n[1]) for i in range(n[0])]
X=sorted(XX)
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x%y) 
ans=X[0]
for i in range(n[0]-1):
    ans=gcd(ans,X[i])
print(ans)
Buggy python submission (verdict: Runtime Error):
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        x=2
    else: 
        k=-1
        x=0
print(a[i-x])

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])

Buggy python submission (verdict: Runtime Error):
a=input()
k=int(input())
i=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
    else: k=-1    
print(a[i])

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])

Buggy python submission (verdict: Time Limit Exceeded):
a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=pow(int(a[i]),x)
    i+=1
print(a[i-1])

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])

Buggy python submission (verdict: Runtime Error):
a=input()
k=int(input())
x=5*pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])

Buggy python submission (verdict: Runtime Error):
a=input()
k=int(input())
x=5*math.pow(10,15)
i=0
while k>0:
    k-=int(str(a)[i])*x
    i+=1
print(str(a)[i-1])

Fixed submission:
a=input()
k=int(input())
if int(a)<10:
    a=str(int(a)*11)
i=0
x=0
while k>=0:
    if a[i]=='1':
        k-=1
        i+=1
        if k==0:
            x=1
            k=-1
    else: 
        k=-1
print(a[i-x])
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=[]
while n!=0:
    if n>0 and n%2==0:
        n=-n//2
        L.append('0')
    elif n>0 and n%2==1:
        n=(-n+1)//2
        L.append('1')
    elif n<0 and -n%2==0:
        n=-n//2
        L.append('0')
    elif n<0 and -n%2==1:
        n=(-n+1)//2
        L.append('1')
print(int(''.join(L[::-1])))

Fixed submission:
n=int(input())
L=[]
if n==0:
    print('0')
else:    
    while n!=0:
        if n>0 and n%2==0:
            n=-n//2
            L.append('0')
        elif n>0 and n%2==1:
            n=(-n+1)//2
            L.append('1')
        elif n<0 and -n%2==0:
            n=-n//2
            L.append('0')
        elif n<0 and -n%2==1:
            n=(-n+1)//2
            L.append('1')
    print(int(''.join(L[::-1])))
Buggy python submission (verdict: Time Limit Exceeded):
D, G=list(map(int, input().split()))
#L[i][0]:i番目の問題数、L[i][0]:i番目のボーナス得点 調整のため[0]追加
L=[0]+[list(map(int, input().split())) for i in range(D)]
#f:i番目まで考えるときの最小問題数  
def f(G, i):
    l=[]
    if i==0:
        return 1000
    else:
    #j:i番目の問題を解く数
        for j in range(min(G//(i*100), L[i][0])+1):
            g=G-j*i*100
            #i番目でボーナス獲得し、足りない点数をi-1番目までで補うとき
            if j==L[i][0] and g-L[i][1]>0:
                l.append(f(g-L[i][1],i-1)+j)
            #i番目でボーナス獲得し、それで点数が足りる時
            elif j==L[i][0] and g-L[i][1]<=0:
                l.append(L[i][0])
            #i番目でボーナス獲得せず、足りない点数をi-1番目までで補うとき
            elif g>0:
                l.append(f(g,i-1)+j)
            #i番目でボーナス獲得せず、それで点数が足りる時
            elif g<=0:
                l.append(j)
                break
        return min(l)
print(f(G,D))

Fixed submission:
D, G=list(map(int, input().split()))
#L[i][0]:i番目の問題数、L[i][0]:i番目のボーナス得点
L=[0]+[list(map(int, input().split())) for i in range(D)]
 
#f:i番目まで考えるときの最小問題数  
def f(G, i):
    if i==0:
	    return 10000
    #n:i番目を絶対に解くときの問題数  
    n=min(G//(i*100), L[i][0])
    #s:i番目を絶対に解くときのスコア  
    s=n*i*100
    #全部解くとき、ボーナスもスコアに加える
    if n==L[i][0]:
        s+=L[i][1]
	#スコアに届かない時、届かない分はG-s点をi-1番目までで埋める
    if s<G:
        n+=f(G-s, i-1)
    #i-1番目までの方が少ない時はそっちを返す
    return min(n, f(G,i-1))
print(f(G, D))

Buggy python submission (verdict: Time Limit Exceeded):
D, G=list(map(int, input().split()))
#L[i][0]:i番目の問題数、L[i][0]:i番目のボーナス得点 調整のため[0]追加
L=[0]+[list(map(int, input().split())) for i in range(D)]
#f:i番目まで考えるときの最小問題数  
def f(G, i):
    l=[]
    if i==0:
        return 10000 
    for j in range(min(G//(i*100), L[i][0])+1):
        if j==L[i][0] and G-j*i*100-L[i][1]>0:
            l.append(f(G-j*i*100-L[i][1],i-1)+j)
        elif j==L[i][0] and G-j*i*100-L[i][1]<=0:
            l.append(L[i][0])
        elif G-j*i*100>0:
            l.append(f(G-j*i*100,i-1)+j)
        elif G-j*i*100<=0:
            l.append(j)
        else:break
    return min(l)

print(f(G,D))

Fixed submission:
D, G=list(map(int, input().split()))
#L[i][0]:i番目の問題数、L[i][0]:i番目のボーナス得点
L=[0]+[list(map(int, input().split())) for i in range(D)]
 
#f:i番目まで考えるときの最小問題数  
def f(G, i):
    if i==0:
	    return 10000
    #n:i番目を絶対に解くときの問題数  
    n=min(G//(i*100), L[i][0])
    #s:i番目を絶対に解くときのスコア  
    s=n*i*100
    #全部解くとき、ボーナスもスコアに加える
    if n==L[i][0]:
        s+=L[i][1]
	#スコアに届かない時、届かない分はG-s点をi-1番目までで埋める
    if s<G:
        n+=f(G-s, i-1)
    #i-1番目までの方が少ない時はそっちを返す
    return min(n, f(G,i-1))
print(f(G, D))
Buggy python submission (verdict: Runtime Error):
n=int(input())
L=[list(map(int, input().split())) for i in range(D)]
print(sum(L)-n)

Fixed submission:
n=int(input())
L=list(map(int, input().split()))
print(sum(L)-n)
Buggy python submission (verdict: Runtime Error):
from collections import deque
h,w=map(int,input().split())
maze=[['#' for i in range(w+2)]]+[['#']+[x=='#' for x in input()]+['#'] for i in range(h)]+[['#' for i in range(w+2)]]
f=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if maze[i][j]:
	    f+=1

pos=deque([(1,1,0)])
while pos:
    x,y,c=pos.popleft()
    if (x,y)==(h,w):
        z=c
        break
    elif maze[x][y]:
        continue    
    pos.append((x-1, y, c+1))
    pos.append((x+1, y, c+1))
    pos.append((x, y-1, c+1))
    pos.append((x, y+1, c+1))
    maze[x][y] = True
    
print(h*w-f-z-1)

Fixed submission:
from collections import deque
h,w=map(int,input().split())
maze=[['#' for i in range(w+2)]]+[['#']+[x=='#' for x in input()]+['#'] for i in range(h)]+[['#' for i in range(w+2)]]
f=0
for i in range(1,h+1):
  for j in range(1,w+1):
    if maze[i][j]:
	    f+=1
z=0
pos=deque([(1,1,0)])
while pos:
    x,y,c=pos.popleft()
    if (x,y)==(h,w):
        print(h*w-f-c-1)
        z=1
        break
    elif maze[x][y]:
        continue
    pos.append((x-1, y, c+1))
    pos.append((x+1, y, c+1))
    pos.append((x, y-1, c+1))
    pos.append((x, y+1, c+1))
    maze[x][y] = True
if z==0:
	print(-1)
Buggy python submission (verdict: Runtime Error):
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
for i in range(2**w):
    l.append(format(i, '0{}b'.format(w)))
for e in l:
    q=[]
    x=int(S[0])
    for i in range(len(e)):
        if e[i]=='0':
            x=x*10+int(S[i+1])
        else:
            q.append(x)
            x=int(S[i+1])
    q.append(x)
    L.append(sum(q))
print(sum(L))

Fixed submission:
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
if w==0:
    print(s)
else:
    for i in range(2**w):
        l.append(format(i, '0{}b'.format(w)))
    for e in l:
        q=[]
        x=int(S[0])
        for i in range(len(e)):
            if e[i]=='0':
                x=x*10+int(S[i+1])
            else:
                q.append(x)
                x=int(S[i+1])
        q.append(x)
        L.append(sum(q))
    print(sum(L))

Buggy python submission (verdict: Runtime Error):
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
for i in range(2**w):
    l.append(format(i, '0{}b'.format(w)))
for e in l:
    q=[]
    x=int(S[0])
    for i in range(len(e)):
        if e[i]=='0':
            x=x*10+int(S[i+1])
        else:
            q.append(x)
            x=int(S[i+1])
    q.append(x)
    L.append(sum(q))
print(sum(L)

Fixed submission:
s=int(input())
S=str(s)
w=len(str(s))-1
l=[]
L=[]
if w==0:
    print(s)
else:
    for i in range(2**w):
        l.append(format(i, '0{}b'.format(w)))
    for e in l:
        q=[]
        x=int(S[0])
        for i in range(len(e)):
            if e[i]=='0':
                x=x*10+int(S[i+1])
            else:
                q.append(x)
                x=int(S[i+1])
        q.append(x)
        L.append(sum(q))
    print(sum(L))
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int, input().split())

print((x-a)%b)

Fixed submission:
x, a, b=[int(input()) for i in range(3)]
print((x-a)%b)
Buggy python submission (verdict: Time Limit Exceeded):
input()
a=list(map(int, input().split())) 
count=0
while all(x%2==0 for x in a):
    x=[x/2 for x in a]
    count+=1
print(count)

Fixed submission:
input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)

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

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

count=0

while all(x%2==0 for x in a):
    x=[x/2 for x in a]
    count+=1

print(count)

Fixed submission:
input()
A=list(map(int,input().split()))
count=0
while all(a%2==0 for a in A):
    A=[a/2 for a in A]
    count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
m=int(input())
n=int(input())
print((m-1)*(n-1))

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

print("H" if a==b else"D)

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

print("H" if a==b else"D")
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N,K,Q = list(map(int,input().split()))
    A = [input() for i in range(Q)]
    P = [K for i in range(N)]

    def calc(n):
        return n-1

    for i in range(Q):
        P = list(map(calc,P))
        P[int(A[i])-1] += 1

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

Fixed submission:
def resolve():
    N,K,Q = list(map(int,input().split()))
    A = [input() for i in range(Q)]
    P = [K] * N

    def calc(n):
        return n-Q

    for i in range(Q):
        P[int(A[i])-1] += 1

    P = list(map(calc, P))

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N,K,Q = list(map(int,input().split()))
    A =[]
    for i in range(Q):
        A.append(input())
    P = []
    for i in range(N):
        P.append(K)
    def calc(n):
        return n-1

    for i in range(Q):
        P = list(map(calc,P))
        P[int(A[i])-1] += 1

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

Fixed submission:
def resolve():
    N,K,Q = list(map(int,input().split()))
    A = [input() for i in range(Q)]
    P = [K] * N

    def calc(n):
        return n-Q

    for i in range(Q):
        P[int(A[i])-1] += 1

    P = list(map(calc, P))

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N,K,Q = list(map(int,input().split()))
    A =[]
    for i in range(Q):
        A.append(input())
    P = []
    for i in range(N):
        P.append(K)
    def calc(n):
        return n-1

    for i in range(Q):
        P = list(map(calc,P))
        As = A[i]
        P[int(As)-1] += 1

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()

Fixed submission:
def resolve():
    N,K,Q = list(map(int,input().split()))
    A = [input() for i in range(Q)]
    P = [K] * N

    def calc(n):
        return n-Q

    for i in range(Q):
        P[int(A[i])-1] += 1

    P = list(map(calc, P))

    for i in range(N):
        if P[i] <= 0:
            print("No")
        else:
            print("Yes")
resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    num = list(range(1,N))
    ans = sum(num)
    print(ans)
resolve()

Fixed submission:
def resolve():
    N = int(input())
    ans = (N-1)*N//2
    print(ans)
resolve()
Buggy python submission (verdict: Runtime Error):
A,B = list(map(int,input().split()))

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu >= hiku and tasu >= kakeru:
  ans = tasu
elif hiku >= tasu and hiku >= kakeru:
  ans = hiku
elif kakru >= tasu and kakeru >= hiku:
  ans = kakeru

print(ans)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu >= hiku and tasu >= kakeru:
  ans = tasu
elif hiku >= tasu and hiku >= kakeru:
  ans = hiku
elif kakeru >= tasu and kakeru >= hiku:
  ans = kakeru

print(ans)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu > hiku and tasu >kakeru:
  ans = tasu
elif hiku > tasu and hiku > kakeru:
  ans = hiku
elif kakru > tasu and kakeru > hiku:
  ans = kakeru

print(ans)

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

tasu = A+B
hiku = A-B
kakeru = A *B

ans =0

if tasu >= hiku and tasu >= kakeru:
  ans = tasu
elif hiku >= tasu and hiku >= kakeru:
  ans = hiku
elif kakeru >= tasu and kakeru >= hiku:
  ans = kakeru

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter

def verify_anagrams(first_word, second_word):
    def get_counter(s):
        return Counter(s)
 
    return get_counter(first_word) == get_counter(second_word)

N = int(input())

S = [0 for i in range(N)]

for i in range(N):
  S[i] = input()
  
ans = 0

for i in range(N):
  for j in range(i+1,N):
    if S[j].count(S[i][i]) == 0:
      continue
    if verify_anagrams(S[i],S[j]) == True:
      ans += 1

print(ans)

Fixed submission:
import collections
def resolve():
    N = int(input())
    S = [input() for i in range(N)]
    ans = 0

    for i in range(N):
        S[i]=str(sorted(S[i]))
    c = collections.Counter(S)
    for i in c.values():
        for j in range(1,i):
            ans += j
    print(ans)
    
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
 
def verify_anagrams(first_word, second_word):
    def get_counter(s):
        return Counter(s.upper())
 
    return get_counter(first_word) == get_counter(second_word)

N = int(input())

S = [0 for i in range(N)]

for i in range(N):
  S[i] = input()
  
ans = 0

for i in range(N):
  for j in range(i+1,N):
    if verify_anagrams(S[i],S[j]) == True:
      ans += 1

print(ans)

Fixed submission:
import collections
def resolve():
    N = int(input())
    S = [input() for i in range(N)]
    ans = 0

    for i in range(N):
        S[i]=str(sorted(S[i]))
    c = collections.Counter(S)
    for i in c.values():
        for j in range(1,i):
            ans += j
    print(ans)
    
resolve()

Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
 
def verify_anagrams(first_word, second_word):
    def get_counter(s):
        return Counter(s.upper().replace(' ', ''))
 
    return get_counter(first_word) == get_counter(second_word)

N = int(input())

S = [0 for i in range(N)]

for i in range(N):
  S[i] = input()
  
ans = 0

for i in range(N):
  for j in range(i+1,N):
    if verify_anagrams(S[i],S[j]) == True:
      ans += 1

print(ans)

Fixed submission:
import collections
def resolve():
    N = int(input())
    S = [input() for i in range(N)]
    ans = 0

    for i in range(N):
        S[i]=str(sorted(S[i]))
    c = collections.Counter(S)
    for i in c.values():
        for j in range(1,i):
            ans += j
    print(ans)
    
resolve()
Buggy python submission (verdict: Runtime Error):
n,d=list(map(int, input().split()))
 
d1=d*2+1
print((n+d1-1)/d1)

Fixed submission:
n=int(input())
print(3*n*n)
Buggy python submission (verdict: Runtime Error):
n=int(input())
d=int(input())

d1=d*2+1
print((n+d1-1)/d1)

Fixed submission:
n,d=list(map(int, input().split()))
 
d1=d*2+1
print(int((n+d1-1)/d1))
Buggy python submission (verdict: Runtime Error):
S = input()

ans="No"
if S[0] == S[1] and S[0] != S[2] and S[0] != S[3] and S[2] == S[3]:
  ans = "Yes"
elif S[1] == S[2] and S[1] != S[0] and S[1] != S[3] and S[0] == S[3]:
  ans = "Yes"
elif S[2] == S[3] and S[2] != S[0] and S[2] != S[1] and S[0] == S[1]:
  ans = "Yes"
elif S[3] == S[0] and S[3] != S[1] and S[3] != S[2] and S[1] == S[2]:
  ans = "Yes"
elif S[1] == S[3] and S[1] != S[0] and S[1] != S[2] and S[2] == S[4]:
  ans = "Yes"

print(ans)

Fixed submission:
S = input()

ans="No"
if S[0] == S[1] and S[0] != S[2] and S[0] != S[3] and S[2] == S[3]:
  ans = "Yes"
elif S[1] == S[2] and S[1] != S[0] and S[1] != S[3] and S[0] == S[3]:
  ans = "Yes"
elif S[2] == S[3] and S[2] != S[0] and S[2] != S[1] and S[0] == S[1]:
  ans = "Yes"
elif S[3] == S[0] and S[3] != S[1] and S[3] != S[2] and S[1] == S[2]:
  ans = "Yes"
elif S[1] == S[3] and S[1] != S[0] and S[1] != S[2] and S[2] == S[0]:
  ans = "Yes"

print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())
W = list(map(int,input().split()))
tmp = 10000000
for i in range(N):
  if tmp >= abs(sum(W[:i+1]) - sum(W[i:])):
    tmp = abs(sum(W[:i+1]) - sum(W[i:]))
    ans = i-1
print(ans)

Fixed submission:
def resolve():
    P,Q,R = map(int,input().split())

    if P+Q <= Q+R and P+Q <= R+P:
        print(P+Q)
    elif Q+R <= R+P and Q+R <= P+Q:
        print(Q+R)
    elif R+P <= P+Q and R+P <= Q+R:
        print(R+P)

resolve()
Buggy python submission (verdict: Runtime Error):
3
100000000 JPY
100.00000000 BTC
0.00000001 BTC

Fixed submission:
N = int(input())
x = [list(input().split()) for i in range(N)]
ans = 0
for i in range(N):
  if x[i][1] == "JPY":
    ans += int(x[i][0])
  elif x[i][1] == "BTC":
    ans += float(x[i][0]) * 380000
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(int,input()))
if A >= B and B >= C:
  print(A*10 + B+C)
elif B >= C and C >=A:
  print(B*10 + C+A)
elif C >= A and A >= B:
  print(C*10 + A+B)

Fixed submission:
A,B,C = list(map(int,input().split()))
if A >= B and B >= C:
  print(A*10 + B+C)
elif B >= C and C >=A:
  print(B*10 + C+A)
elif C >= A and A >= B:
  print(C*10 + A+B)
elif A >= B and C >= B:
  print(A*10 + B+C)
elif B >= A and A >= C:
  print(B*10 + A+C)
elif C >= A and B >= A:
  print(C*10 + A+B)
Buggy python submission (verdict: Runtime Error):
A,B = list(map(int,input()))

print(A-B+1)

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

print(A-B+1)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = list(map(int,input()))
ans = "No"
if abs(a-c) < d:
  ans = "Yes"
elif abs(a-b) < d and abs(b-c) < d:
  ans = "Yes"
print(ans)


Fixed submission:
a,b,c,d = list(map(int,input().split()))
ans = "No"
if abs(a-c) <= d:
  ans = "Yes"
elif abs(a-b) <= d and abs(b-c) <= d:
  ans = "Yes"
print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,c,d = list(map(int,input()))
ans = "No"
if abs(a-c) < d:
  ans = "Yes"
elif abs(a-b) < d and abs(b-c) < d:
  ans = "Yes"


Fixed submission:
a,b,c,d = list(map(int,input().split()))
ans = "No"
if abs(a-c) <= d:
  ans = "Yes"
elif abs(a-b) <= d and abs(b-c) <= d:
  ans = "Yes"
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K= list(map(int,input().split()))

AK = A+K-1
BK = B-K+1
for i in range(A,B+1):
  if i >= A and i <= AK:
    print(i)
  elif i >= BK and i <= B:
    print(i)

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

AK = A+K-1
BK = B-K+1
for i in range(A,A+K):
  if i <= B:
    if i >= A and i <= AK:
      print(i)
for i in range(BK,B+1): 
  if (i <= AK)!=1:
    if i >= BK and i <= B:
      print(i)

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

tmp = n[0]
sum1=1
for i in range(1,S):
  if tmp <= n[i]:
    tmp=n[i]
    sum1=sum1+1
print(sum1)

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

AK = A+K-1
BK = B-K+1
for i in range(A,A+K):
  if i <= B:
    if i >= A and i <= AK:
      print(i)
for i in range(BK,B+1): 
  if (i <= AK)!=1:
    if i >= BK and i <= B:
      print(i)
Buggy python submission (verdict: Runtime Error):
N – int(input())
A – int(input())
ans = "No"
if N % 500 < A:
  ans = "Yes"
print(ans)

Fixed submission:
N = int(input())
A = int(input())
ans = "No"
if N % 500 <= A:
  ans = "Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
x,a,b = list(map(int,input().split()))
if b >= c:
  print("delicious")
elif a+b < c:
  print("dangerous")
else:
  print("safe")

Fixed submission:
a,b,c = list(map(int,input().split()))
if b >= c:
  print("delicious")
elif a+b < c:
  print("dangerous")
else:
  print("safe")
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(input()))
ans="NO"
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  ans = "YES"
print(ans)

Fixed submission:
A,B,C = list(map(str,input().split()))
ans="NO"
if A[len(A)-1] == B[0] and B[len(B)-1] == C[0]:
  ans = "YES"
print(ans)
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))

ans = 0

for i in range(1,B+1):
  if A*i % B == C:
    ans = 1

if ans == 1:
  print(YES)
else :
  print(NO)

Fixed submission:
A,B,C = list(map(int,input().split()))
 
ans = 0
 
for i in range(1,B+1):
  if A*i % B == C:
    ans = 1
 
if ans == 1:
  print("YES")
else :
  print("NO")
Buggy python submission (verdict: Runtime Error):
a,b = list(map(int,input().split()))
print(a+b) if 24 > a+b else prin(a+b-24)

Fixed submission:
a,b = list(map(int,input().split()))
print(a+b) if 24 > a+b else print(a+b-24)
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))
if sort([A,B,C]) == [5,5,7]:
  print("YES")
else:
  print("NO")

Fixed submission:
A,B,C = list(map(int,input().split()))
if sorted([A,B,C]) == [5,5,7]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if str(int(str(a) + str(b))**0.5) % 1 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b = map(int,input().split())
ab = int(str(a) + str(b))
abroot = str(ab**0.5)
if abroot.split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a, b = map(int,input().split())
if str(int(str(a) + str(b))**0.5) % 1 == "0":
    print("Yes")
else:
    print("No")

Fixed submission:
a, b = map(int,input().split())
ab = int(str(a) + str(b))
abroot = str(ab**0.5)
if abroot.split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
if str(int(str(map(int,input().split())[0]) + str(map(int,input().split())[1]))**0.5).split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")

Fixed submission:
a, b = map(int,input().split())
ab = int(str(a) + str(b))
abroot = str(ab**0.5)
if abroot.split(".")[1:][0] == "0":
    print("Yes")
else:
    print("No")