Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, raw_input().split())

if A+B+C+D == 7:
    print '%s+%s+%s+%s' % (A, B, C, D)
elif A+B+C-D == 7:
    print '%s+%s+%s-%s' % (A, B, C, D)
elif A+B-C+D == 7:
    print '%s+%s-%s+%s' % (A, B, C, D)
elif A-B+C+D == 7:
    print '%s-%s+%s+%s' % (A, B, C, D)
elif A+B-C-D == 7:
    print '%s+%s-%s-%s' % (A, B, C, D)
elif A-B+C-D == 7:
    print '%s-%s+%s-%s' % (A, B, C, D)
elif A-B-C+D == 7:
    print '%s-%s-%s+%s' % (A, B, C, D)
elif A-B-C-D == 7:
    print '%s-%s-%s-%s' % (A, B, C, D)

Fixed submission:
# -*- coding: utf-8 -*-
s = raw_input()
A = int(s[0])
B = int(s[1])
C = int(s[2])
D = int(s[3])

if A+B+C+D == 7:
    print '%s+%s+%s+%s=7' % (A, B, C, D)
elif A+B+C-D == 7:
    print '%s+%s+%s-%s=7' % (A, B, C, D)
elif A+B-C+D == 7:
    print '%s+%s-%s+%s=7' % (A, B, C, D)
elif A-B+C+D == 7:
    print '%s-%s+%s+%s=7' % (A, B, C, D)
elif A+B-C-D == 7:
    print '%s+%s-%s-%s=7' % (A, B, C, D)
elif A-B+C-D == 7:
    print '%s-%s+%s-%s=7' % (A, B, C, D)
elif A-B-C+D == 7:
    print '%s-%s-%s+%s=7' % (A, B, C, D)
elif A-B-C-D == 7:
    print '%s-%s-%s-%s=7' % (A, B, C, D)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
n=int(input())
A=list(map(int,input().split()))
mod=10**9+7
ans=0
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        ans+=A[i]*A[j]
        
print(ans%mod)

Fixed submission:
# coding: utf-8
# Your code here!
n=int(input())
A=list(map(int,input().split()))
mod=10**9+7
ans=0
s=[]
sum_a=0
for i in range(n-1):
    sum_a+=A[i]
    ans+=sum_a*A[i+1]
    #s.append(sum_a)
print(ans%mod)
"""
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        ans+=A[i]*A[j]
        
print(ans%mod)
"""
Buggy python submission (verdict: Time Limit Exceeded):
X,K,D=map(int,input().split())
i=0
count=0
if X<0:
	if X+K*D<=0:
		print(abs(X+K*D))
		count+=1
	else:
		L=X+i*D
		while L<=0:
			i+=1
			L=X+i*D
		if abs(L)>=abs(X+(i+1)*D):
			i+=1
			L=abs(X+i*D)
else:
	if X-K*D>=0:
		print(abs(X-K*D))
		count+=1
	else:
		L=X-i*D
		while L>=0:
			i+=1
			L=X-i*D
		if abs(L)>=abs(X-(i-1)*D):
			i-=1
			L=abs(X-i*D)
if count==0:
	kaisuu=K-i
	if kaisuu%2==0:
		print(abs(L))

	else:
		a=abs(L+D)
		b=abs(L-D)
		if a<=b:
			print(a)
		else:
			print(b)

		

Fixed submission:
X,K,D=map(int,input().split())
X=abs(X)
count=0

if X-K*D>=0:
	print(X-K*D)
else:
	s=int(X/D)
	kaisuu=K-s
	if kaisuu%2==0:
		print(abs(X-s*D))
	else:
		print(abs(X-(s+1)*D))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,N=map(int,input().split())
max_L=0
x=0
while x<B and x<=N:
	L=int(A*x/B)-A*int(x/B)
	if max_L<=L:
		max_L=L
		x+=1
	else:
		break

"""
if B>N:
	while x<=N:
		L=int(A*x/B)-A*int(x/B)
		if x<N:
			if max_L<=L:
				max_L=L
				x+=1
			else:
				break
		else:
			if max_L<=L:
				max_L=L
				break
			else:
				x-=1
				break
else:
	while x<B:
		L=int(A*x/B)-A*int(x/B)
		if max_L<=L:
			max_L=L
			x+=1
		else:
			break
"""
print(max_L)

Fixed submission:
A,B,N=map(int,input().split())
max_L=0
x=0
if B>N:
	x=N
	max_L=int(A*x/B)-A*int(x/B)
else:
	x=B-1
	max_L=int(A*x/B)-A*int(x/B)

print(max_L)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
#A,B,C,D=map(int,input().split())
count=0
for i in range(N):
	s=input()
	if s not in S:
		S.append(s)
		count+=1
print(count)

Fixed submission:
N=int(input())
S={0}
#A,B,C,D=map(int,input().split())

for i in range(N):
	S.add(input())
print(len(S)-1)
Buggy python submission (verdict: Runtime Error):
import math
N,M=input().split()
A=list(map(int, input().split()))
N=int(N)
if N>=sum(A):
	print(N-sum(A))
else:
	print(-1)

Fixed submission:
import math
R=int(input())
L=2*math.pi*R
print(L)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
S=[]
count=[0]*N
A=[]

for i in range(N):
	S.append(input())
    
S=sorted(S)

for i in range(N):
	for j in range(N):
		if S[i]==S[j]:
			count[i]+=1              

for i in range(N):
	if max(count)==count[i]:
		A.append(S[i])
A=sorted(set(A))

for i in range(len(A)):
	print(A[i])


Fixed submission:
# coding: utf-8
# Your code here!
import sys
from collections import Counter
import numpy as np
n=int(input())
S=[]
for i in range(n):
    S.append(input())
s=Counter(S)
keys, values = zip(*s.most_common())

values=np.array(values)
index=np.where(values==np.max(values))
answer=[]
for i in index[0]:
    answer.append(keys[i])
answer.sort()
for i in answer:
    print(i)
Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))

flag=0
for i in range(N):
	count=0
	for j in range(N):
		if a[i]==a[j] and i!=j:
			count+=1
			print("No")
			flag+=count
			break
		else:
			continue
	if count>=1:
		break
if flag==0:
	print("Yes")

Fixed submission:
# coding: utf-8
# Your code here!
n=int(input())
s=set(input().split())
if len(s)==n:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K=input().split()
K=int(K)

A=list(map(int, input().split()))
A=np.array(A)
sort_A=np.sort(A)[::-1]
sort_A=sort_A[K:]

print(np.sum(sort_A))


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

count=0
while H>0:
  H=H-A
  count+=1
print(count)

Buggy python submission (verdict: Runtime Error):
import numpy as np
N,K=input().split()
N=int(N)
K=int(K)

A=list(map(int, input().split()))
A=np.array(A)
sort_A=np.sort(A)[::-1]
sort_A=sort_A[K:]

print(np.sum(sort_A))

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

count=0
while H>0:
  H=H-A
  count+=1
print(count)
Buggy python submission (verdict: Runtime Error):
import numpy as np
H,N=input().split()
H=int(H)
N=int(N)

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

count=0
for i in range(N):
  count+=A[i]

if count=>H:
  print("yes")
else:
  print("no")

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

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

count=0
for i in range(N):
  count+=A[i]

if count>=H:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N=input()
s=input()

print(s.count('ABC'))

Fixed submission:
k,x=input().split()

if 500*int(k)>=int(x):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
T,A,K=input().split()
T=int(T)
A=int(A)
K=int(K)

for i in range(K):
	if T>=1:
		T-=1
	elif A>=1:
		A-=1
	else:
		pass
      
print(T,A)


Fixed submission:
T,A,K=input().split()
T=int(T)
A=int(A)
K=int(K)

if T>=K:
	T=T-K
	print(T,A)
elif T<K:
	K=K-T
	T=0
	A=A-K
	if A<0:
		A=0
		print(T,A)
	else:
		print(T,A)
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for i in range(n)]
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[n-1])

Fixed submission:
import math
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for i in range(n)]
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[n-1])

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
import math
n,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for _ in range(n)]
dp[0]=0
for i in range(1,n):
    for k in range(1,K+1):
        if i-k<0:
            continue
        else:
            dp[i]=min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))
print(dp[n-1])

Fixed submission:
import math
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for i in range(n)]
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[n-1])

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
import math
n,K=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for _ in range(n)]
dp[0]=0
for i in range(1,n):
    for k in range(K):
        if i-k<0:
            continue
        else:
            dp[i]=min(dp[i],dp[i-k]+abs(h[i]-h[i-k]))
        print(dp)
print(dp)

Fixed submission:
import math
n,k=map(int,input().split())
h=list(map(int,input().split()))
dp=[math.inf for i in range(n)]
dp[0]=0
for i in range(1,n):
    for j in range(1,k+1):
        if i-j<0:
            continue
        dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i])
print(dp[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i + 1))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
result = [0] * n
for x in a:
    result[x-1] += 1
for v in result:
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
    print(a.count(i + 1))


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
result = [0] * n
for x in a:
    result[x-1] += 1
for v in result:
    print(v)
Buggy python submission (verdict: Time Limit Exceeded):
BILLS = [10000, 5000, 1000]


def distribute_rest(length, rest, result=[], current=[]):
    if length == 1:
        current.append(rest)
        result.append(current)
    else:
        for i in range(rest + 1):
            result = distribute_rest(
                length - 1, rest - i, result, list(current) + [i])
    return result


def main(n, y):
    bill_counts = None
    for counts in distribute_rest(len(BILLS), n):
        price = sum([bill * count for bill, count in zip(BILLS, counts)])
        if price == y:
            bill_counts = counts
            break
    if not bill_counts:
        bill_counts = [-1, -1, -1]
    print(' '.join([str(x) for x in bill_counts]))


if __name__ == "__main__":
    n, y = [int(x) for x in input().split()]
    main(n, y)


Fixed submission:
BILLS = [10000, 5000, 1000]


def calc_price(counts):
    return sum([bill * count for bill, count in zip(BILLS, counts)])


def main(n, y):
    for c1 in range(n + 1):
        for c2 in range(0, n - c1 + 1):
            counts = [c1, c2, n - c1 - c2]
            if calc_price(counts) == y:
                print(' '.join([str(c) for c in counts]))
                return
    print('-1 -1 -1')


if __name__ == "__main__":
    n, y = [int(x) for x in input().split()]
    main(n, y)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())]
if a <= b:
  print("unsafe")
elif a > b:
  print("safe")

Fixed submission:
a, b = map(int, input().split())
if a <= b:
  print("unsafe")
else:
  print("safe")

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())]
if a < b:
  print("unsafe")
else:
  print("safe")

Fixed submission:
a, b = map(int, input().split())
if a <= b:
  print("unsafe")
else:
  print("safe")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = list(map(int, input().split()))
for i in range(1,n+1):
    print(m.count(i))


Fixed submission:
n = int(input())
a = [0] * n
m = list(map(int, input().split()))
for i in m:
    a[i-1] += 1
for i in a:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = list(map(int, input().split()))
list_number = []
for i in range(1,n+1):
    list_number.append(m.count(i))
for i in list_number:
    print(i)

Fixed submission:
n = int(input())
a = [0] * n
m = list(map(int, input().split()))
for i in m:
    a[i-1] += 1
for i in a:
    print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
if 7 in n:
  print("Yes")
else:
  print("No")

Fixed submission:
a = input()
b = 0
for i in a:
    i = int(i)
    if i == 7:
        b += 1
if b == 0:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())
sum = 0
for i in range(1, n + 1):
  if i !% 3 or i !% 5:
    sum = sum + i
print(sum)

Fixed submission:
a = int(input())
sum = 0
list_number = []
for i in range(a):
    list_number.append(i + 1)
for i in list_number:
    if i % 3 == 0 and i % 5 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        sum = sum + i
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
from math import gcd
n = int(input())
a, b, c = 1, 1, 1
sum = 0
while True:
    sum += gcd(gcd(a, b), c)
    if n > c:
        c += 1
    elif n == c and n == b and n == a:
        break
    elif n == c and n == b:
        a += 1
        b = 1
        c = 1
    elif n == c:
        b += 1
        c = 1
print(sum)

Fixed submission:
from math import gcd
n = int(input())
sum = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            sum += gcd(gcd(i, j), k)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*number):
    return reduce(math.gcd, number)
n = int(input())
sum = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            sum += gcd(i, j, k)
print(sum)

Fixed submission:
from math import gcd
n = int(input())
sum = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            sum += gcd(gcd(i, j), k)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*number):
    return reduce(math.gcd, number)
n = int(input())
a, b, c = 1, 1, 1
sum = 0
while True:
    sum += gcd(a, b, c)
    if n > c:
        c += 1
    elif n == c and n == b and n == a:
        break
    elif n == c and n == b:
        a += 1
        b = 1
        c = 1
    elif n == c:
        b += 1
        c = 1
print(sum)

Fixed submission:
from math import gcd
n = int(input())
sum = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            sum += gcd(gcd(i, j), k)
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce
def gcd(*number):
    return reduce(math.gcd, number)
n = int(input())
a, b, c = 1, 1, 1
sum = 0
list_number = []
while True:
    list_number.append(gcd(a, b, c))
    if n > c:
        c += 1
    elif n == c and n == b and n == a:
        break
    elif n == c and n == b:
        a += 1
        b = 1
        c = 1
    elif n == c:
        b += 1
        c = 1
for i in list_number:
    sum = sum + i
print(sum)

Fixed submission:
from math import gcd
n = int(input())
sum = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            sum += gcd(gcd(i, j), k)
print(sum)
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = a.sort(reverse = True)
b = sum(a)
c = 0
d = "Yes"
l = 1 / (4 * m)
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  c += 1
print(d)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
b = 0
c = 0
d = ""
l = 1 / (4 * m)
for i in a:
    b += i
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  else:
    d = "Yes"
  c += 1
print(d)

Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
a = list(map(int, input().split()))
a = sort(a)
b = sum(a)
c = 0
d = "Yes"
l = 1 / (4 * m)
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  c += 1
print(d)

Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
b = 0
c = 0
d = ""
l = 1 / (4 * m)
for i in a:
    b += i
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  else:
    d = "Yes"
  c += 1
print(d)

Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
a = list(map(int, input().split()))
b = 0
c = 0
d = "Yes"
l = 1 / (4 * m)
for i in a:
  b += i
b = b * l
while c < m:
  if a[c] < b:
    d = "No"

print(d)


Fixed submission:
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse = True)
b = 0
c = 0
d = ""
l = 1 / (4 * m)
for i in a:
    b += i
b = b * l
while c < m:
  if a[c] < b:
    d = "No"
  else:
    d = "Yes"
  c += 1
print(d)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
list = []
list.append(n)
a = 0
while True:
  n = abs(n - k)
  if list[a] < n:
    n = list[a]
    break
  else:
  	list.append(n)
  a += 1

print(n)

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

n = n % k

print(min(n, abs(n - k)))
Buggy python submission (verdict: Runtime Error):
n = input()
a = (len(n) - 1)//2
b = (len(n) + 3)//2
if n == n[::-1]:
  if n[0:a-1] == n[0:a-1:-1]:
    if n[b-1:len(n)-1] == n[b-1:len(n)-1:-1]:
      print("Yes")
  	else:
      print("No")
  else:
    print("No")
else:
  print("No")
    

Fixed submission:
n = input()
a = ((len(n) - 1)//2)
b = ((len(n) + 3)//2)-1
if n == n[::-1]:
    if n[:a] == n[-a::]:
        if n[b:] == n[:-b]:
            print("Yes")
        else:
            print("No")
    else:
        print("No")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
if n==M:
    print("Yes")
else:
    print("No")

Fixed submission:
n,m=map(int,input().split())
if n==m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=int(n)
m=int(m)
x=[false for i in range(n)]
count=[0 for i in range(n)]
for i in range(m):
  p,s=input().split()
  p=int(p)
  if(not x[p-1]):
    if(s=="AC"):
      x[p-1]=true
    else:
      count[p-1]=count[p-1]+1
ans=0
ans2=0
for i in range(ansn):
  if(x[i]):
    ans+=1
    ans2+=count[i]
print(ans,ans2)

Fixed submission:
n,m=input().split()
n=int(n)
m=int(m)
x=[False for i in range(n)]
count=[0 for i in range(n)]
for i in range(m):
  p,s=input().split()
  p=int(p)
  if(not x[p-1]):
    if(s=="AC"):
      x[p-1]=True
    else:
      count[p-1]=count[p-1]+1
ans=0
ans2=0
for i in range(n):
  if(x[i]):
    ans+=1
    ans2+=count[i]
print(ans,ans2)
Buggy python submission (verdict: Runtime Error):
n=int(n)
m=int(m)
x=[false for i in range(n)]
count=[0 for i in range(n)]
for i in range(m):
  p,s=input().split()
  p=int(p)
  if(not x[p-1]):
    if(s=="AC"):
      x[p-1]=true
    else:
      count[p-1]=count[p-1]+1
ans=0
ans2=0
for i in range(ansn):
  if(x[i]):
    ans+=1
    ans2+=count[i]
print(ans,ans2)

Fixed submission:
import math
import itertools
n=int(input())

a=list(map(str,input().split()))
b=list(map(str,input().split()))

p=str(math.factorial(n))

a_list = [''.join(v) for v in itertools.permutations(a)]
a_int = [int(i) for i in a_list]
a_int.sort()

a_=[int(i) for i in a]
b_=[int(j) for j in b]
x="".join(a)
y="".join(b)

p_=a_int.index(int(x))+1
q_=a_int.index(int(y))+1

sum=abs(p_-q_)
print(sum)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
T=list(input()) 
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Fixed submission:
N=int(input())
S,T=input().split()
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
T=list(input()) 
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Fixed submission:
N=int(input())
S,T=input().split()
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
T=list(input())  
sum=""
for i in range(N):
  sum= sum+S[i]+T[i]
print(sum)

Fixed submission:
N=int(input())
S,T=input().split()
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(input())
T=list(input())  
sum=""
for i in range(n):
  sum= sum+s[i]+t[i]
print(sum)

Fixed submission:
N=int(input())
S,T=input().split()
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=list(input())
t=list(input())  
sum=""
for i in range(n):
  sum= sum+s[i]+t[i]
print(sum)

Fixed submission:
N=int(input())
S,T=input().split()
sum=""
for i in range(N):
  sum+=S[i]
  sum+=T[i]
print(sum)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(i) for i in input().split()]
x=0
y=0
l=float("inf")
for i in range(n-1):
  x+=a[i]
  y=sum(a)-x
  l=min(l,abs(x-y))
print(l)

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
x=0
y=sum(a)
l=float("inf")
for i in range(n-1):
  x+=a[i]
  y=y-a[i]
  l=min(l,abs(x-y))
print(l)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(i) for i in input().split()]
l=[]

for i in range(1,n):
  j=n-i
  x=sum(a[:i])
  y=sum(a[i:n])
  l.append(abs(x-y))
l.sort()
print(l[0])

Fixed submission:
n=int(input())
a=[int(i) for i in input().split()]
x=0
y=sum(a)
l=float("inf")
for i in range(n-1):
  x+=a[i]
  y=y-a[i]
  l=min(l,abs(x-y))
print(l)
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if b-a<=0:
  print("delicious")
elif b-a=0 and x-(b-a)>=0:
  print("safe")
else:
  print("dangerous")


Fixed submission:
x,a,b=map(int,input().split())
if b-a<=0:
  print("delicious")
elif b-a>0 and x-(b-a)>=0:
  print("safe")
else:
  print("dangerous")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
a,b,c=map(int,input().split())

for i in range(10**9):
  if (a*i)%b==c:
    print("YES")
    sys.exit()
print("NO")

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

for i in range(10**5):
  if (a*i)%b==c:
    print("YES")
    sys.exit()
print("NO")
Buggy python submission (verdict: Runtime Error):
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N=<K:
  print(N*X)
else:
  print(K*X + (N-K)*Y)


Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)

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

if N=>K:
  print(N*X)
else:
  print(K*X + (N-K)*Y)


Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)

Buggy python submission (verdict: Runtime Error):
N=input()
K=input()
X=input()
Y=input()

if N=>K:
  print(N*X)
else:
  print(K*X + (N-K)*Y)

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)

Buggy python submission (verdict: Runtime Error):
N=input()
K=input()
X=input()
Y=input()
if N<=K:
  print(N*X)
else:
  print(K*X + (N-K)*Y)
  

Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)

Buggy python submission (verdict: Runtime Error):
a=input().split
int(a)
N=a(0) 
K=a(1)
X=a(2)
Y=a(3)
if N > K:
  tot = K*X+(N-K)*Y
else:
  tot = N*X
print(tot)


Fixed submission:
N=int(input())
K=int(input())
X=int(input())
Y=int(input())

if N > K:
  print(K*X+(N-K)*Y)
else:
  print(N*X)
Buggy python submission (verdict: Runtime Error):
import sys
w = list(input())

for i in w.count(i):
  if i%2==1:
    print("No")
    sys.exit()
print("Yes")

Fixed submission:
import sys
w = list(input())
for i in w:
  if w.count(i) %2 == 1:
    print("No")
    sys.exit()
print("Yes")

Buggy python submission (verdict: Runtime Error):
w = list(input())
for i in w:
  if count.w(i) %2 == 1:
    print("No")
    break
print("Yes")
  

Fixed submission:
import sys
w = list(input())
for i in w:
  if w.count(i) %2 == 1:
    print("No")
    sys.exit()
print("Yes")
Buggy python submission (verdict: Runtime Error):
a = input()
a=int(a)
ans=0
for i in ramge(1,a+1):
  ans+=i
print(ans)

Fixed submission:
a = input()
a=int(a)
ans=0
for i in range(1,a+1):
  ans+=i
print(ans)