Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
import math
a=2
def lcm(a,n):
    return (a*n)//math.gcd(a,n)
print(lcm(a,n))

Fixed submission:
a=int(input())
b=2
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
for i in range(1,10**9):
    if i%2==0 and i%n==0:
        print(i)
        exit()


Fixed submission:
a=int(input())
b=2
def gcd(a,b):
    while b!=0:
        a,b=b,a%b
    return a
def lcm(a,b):
    return a*b//gcd(a,b)
print(lcm(a,b))
Buggy python submission (verdict: Runtime Error):
d,n=map(int,input().split())
if d==0:
    print(n)
else:
    for i in range(n+1):
        a=100**d*i
print(a)


Fixed submission:
d,n=map(int,input().split())
if d==0:
    if n==100:
        print(n+1)
    else:
        print(n)
elif d==1:
    if n==100:
        print(100*n+100)
    else:
        print(100*n)
elif d==2:
    if n==100:
        print(n*10000+10000)
    else:
        print(n*10000)
Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(n):
    for j in range(1,i+k+1):
        ans.append(s[i:j])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
print(ans[k-1])

Fixed submission:
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(n):
    for j in range(i+1,i+k+1):
        ans.append(s[i:j])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
print(ans[k-1])

Buggy python submission (verdict: Time Limit Exceeded):
s=input()
k=int(input())
ans=[]
n=len(s)
for i in range(n):
    for j in range(n):
        ans.append(s[i:j+1])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
if n==1:
    print(s)
else:
    print(ans[k-1])


Fixed submission:
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(n):
    for j in range(i+1,i+k+1):
        ans.append(s[i:j])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
print(ans[k-1])

Buggy python submission (verdict: Runtime Error):
s=input()
k=int(input())
ans=[]
n=len(s)
for i in range(n):
    for j in range(n):
        ans.append(s[i:j+1])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
if n==1:
    print(s)
else:
    print(ans[k])


Fixed submission:
s=input()
k=int(input())
n=len(s)
ans=[]
for i in range(n):
    for j in range(i+1,i+k+1):
        ans.append(s[i:j])
ans=list(set(ans))
ans.sort()
if "" in ans:
    ans.pop(0)
print(ans[k-1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
ans=[]
a.sort()
cnt=0
for i in range(n):
    v=a[i]
    a[i]=0
    a.sort()
    for j in range(1,n):
        cnt+=a[j]-a[j-1]
    ans.append(cnt+(max(a)-min(a)))
    cnt=0
    a[i]=v
for i in ans:
    print(i)
    


Fixed submission:
a=int(input())
b=int(input())
c=int(input())
d=int(input())
print(min(a,b)+min(c,d))
Buggy python submission (verdict: Runtime Error):
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
	int n;
	cin >>n;
	int a[110];
	for(int i=0;i<n;++i)cin >>a[i];
	sort(a,a+n,greater<int>());
	int alic=0;
	int bob=0;
	for(int i=0;i<n;++i){
		if(i%2==0){
			alic+=a[i];
		}
		else{
			bob+=a[i];
		}
	}
	cout <<alic-bob<<endl;
}


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.sort()
a.reverse()
v=sum(a)
alice_count=0
for i in range(n):
    if i%2==0:
        alice_count+=a[i]
bob_count=v-alice_count
print(alice_count-bob_count)
Buggy python submission (verdict: Runtime Error):
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,y;
    cin>>n>>y;
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            int z=y-(10000*i+5000*j);
            if(z%1000==0){
                z/=1000;
                if(0<=z && i+j+z==n){
                    cout<<i<<" "<<j<<" "<<z<<endl;
                    return 0;
                }
            }
        }
    }
   cout<<-1<<" "<<-1<<" "<<-1<<endl;
    return 0;
}

Fixed submission:
def test():
    n,y=map(int,input().split())
    a,b,c=10000,5000,1000
    for i in range(n+1):
        for j in range(n+1):
            ans=a*i+b*j
            if y<ans:
                break
            if (y-ans)%c==0:
                k=(y-ans)//c
                if i+j+k==n:
                    return i,j,k
    return -1,-1,-1
one,two,three=test()
print(one,two,three)

Buggy python submission (verdict: Time Limit Exceeded):
n,x=map(int,input().split())
for i in range(n+1):
        for j in range(n+1):
                z=x-(10000*i+5000*j)
                if z%1000==0:
                        z//=1000
                        if 0<=z and i+j+z==n:
                                print(i,j,z)
                                exit()
print(-1,-1,-1)

Fixed submission:
def test():
    n,y=map(int,input().split())
    a,b,c=10000,5000,1000
    for i in range(n+1):
        for j in range(n+1):
            ans=a*i+b*j
            if y<ans:
                break
            if (y-ans)%c==0:
                k=(y-ans)//c
                if i+j+k==n:
                    return i,j,k
    return -1,-1,-1
one,two,three=test()
print(one,two,three)

Buggy python submission (verdict: Time Limit Exceeded):
n,x=map(int,input().split())
for i in range(n+1):
        for j in range(n+1):
                for z in range(n+1):
                        total=10000*i+5000*j+1000*z
                        if total==x and i+j+z==n:
                                print(i,j,z)
                                exit()
print(-1,-1,-1)

Fixed submission:
def test():
    n,y=map(int,input().split())
    a,b,c=10000,5000,1000
    for i in range(n+1):
        for j in range(n+1):
            ans=a*i+b*j
            if y<ans:
                break
            if (y-ans)%c==0:
                k=(y-ans)//c
                if i+j+k==n:
                    return i,j,k
    return -1,-1,-1
one,two,three=test()
print(one,two,three)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
set_a=set(a)
count=0
for i in set_a:
    if i<a.count(i):
        count+=a.count(i)-i
    if a.count(i)<i:
        count+=a.count(i)
print(count)


Fixed submission:
from collections import Counter
n=int(input())
counter=Counter(map(int,input().split()))
sum=0
for a,cnt in counter.items():
    if cnt<a:
        sum+=cnt
    else:
        sum+=cnt-a
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
set_a=list(set(a))
set_a.sort()
count=0
for i in set_a:
    if i<a.count(i):
        count+=a.count(i)-i
    elif a.count(i)<i:
        count+=a.count(i)
print(count)

        


Fixed submission:
from collections import Counter
n=int(input())
counter=Counter(map(int,input().split()))
sum=0
for a,cnt in counter.items():
    if cnt<a:
        sum+=cnt
    else:
        sum+=cnt-a
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
set_a=set(a)
count=0
for i in set_a:
    if i<a.count(i):
        count+=a.count(i)-i
    elif a.count(i)<i:
        count+=a.count(i)
print(count)


Fixed submission:
from collections import Counter
n=int(input())
counter=Counter(map(int,input().split()))
sum=0
for a,cnt in counter.items():
    if cnt<a:
        sum+=cnt
    else:
        sum+=cnt-a
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
set_a=list(set(a))
count=0
for i in set_a:
    if i<a.count(i):
        count+=a.count(i)-i
    elif a.count(i)<i:
        count+=a.count(i)
print(count)

Fixed submission:
from collections import Counter
n=int(input())
counter=Counter(map(int,input().split()))
sum=0
for a,cnt in counter.items():
    if cnt<a:
        sum+=cnt
    else:
        sum+=cnt-a
print(sum)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
c=set(a)
count=0
for i in c:
    w=a.count(i)
    if w!=i:
        if i<w:
            count+=w-i
        else:
            count+=w
print(count)

Fixed submission:
from collections import Counter
n=int(input())
counter=Counter(map(int,input().split()))
sum=0
for a,cnt in counter.items():
    if cnt<a:
        sum+=cnt
    else:
        sum+=cnt-a
print(sum)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
n,k=map(int,input().split())
cnt=list(sorted(Counter(map(int,input().split().values()))))
num=len(cnt)
ans=0
for v in cnt:
    if num<=k:
        break
    ans+=v
    num-=1
print(ans)


Fixed submission:
from collections import Counter
n,k=map(int,input().split())
a=list(map(int,input().split()))
counter=Counter(a)
ans=[]
for i in counter.values():
    ans.append(i)
ans.sort()
ans.reverse()
v=sum(ans[0:k])
print(n-v)
Buggy python submission (verdict: Runtime Error):
ans=list(input())
a=int(ans[0])
b=int(ans[1])
c=int(ans[2])
d=int(ans[3])
    pass=int(ans[3])
if b+c+d+e==7:
    print(str(a)+"+"str(b)+"+"+str(c)+"+"+str(d)=="7")
elif a+b+c-d==7:
    print(str(a)+'+'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a+b-c+d==7:
    print(str(a)+'+'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a+b-c-d==7:
    print(str(a)+'+'+str(b)+'-'+str(c)+'-'+str(d)+'=7')
elif a-b+c+d==7:
    print(str(a)+'-'+str(b)+'+'+str(c)+'+'+str(d)+'=7')
elif a-b+c-d==7:
    print(str(a)+'-'+str(b)+'+'+str(c)+'-'+str(d)+'=7')
elif a-b-c+d==7:
    print(str(a)+'-'+str(b)+'-'+str(c)+'+'+str(d)+'=7')
elif a-b-c-d==7:
    print(str(a)+'-'+str(b)+'-'+str(c)+'-'+str(d)+'=7')


Fixed submission:
a=list(map(int,input()))
if a[0]+a[1]+a[2]+a[3]==7:
    print(str(a[0])+"+"+str(a[1])+"+"+str(a[2])+"+"+str(a[3])+"=7")
    exit()
elif a[0]+a[1]+a[2]-a[3]==7:
    print(str(a[0])+"+"+str(a[1])+"+"+str(a[2])+"-"+str(a[3])+"=7")
    exit()
elif a[0]+a[1]-a[2]+a[3]==7:
    print(str(a[0])+"+"+str(a[1])+"-"+str(a[2])+"+"+str(a[3])+"=7")
    exit()
elif a[0]+a[1]-a[2]-a[3]==7:
    print(str(a[0])+"+"+str(a[1])+"-"+str(a[2])+"-"+str(a[3])+"=7")
    exit()
elif  a[0]-a[1]+a[2]+a[3]==7:
    print(str(a[0])+"-"+str(a[1])+"+"+str(a[2])+"+"+str(a[3])+"=7")
    exit()
elif a[0]-a[1]+a[2]-a[3]==7:
    print(str(a[0])+"-"+str(a[1])+"+"+str(a[2])+"-"+str(a[3])+"=7")
    exit()
elif a[0]-a[1]-a[2]+a[3]==7:
    print(str(a[0])+"-"+str(a[1])+"-"+str(a[2])+"+"+str(a[3])+"=7")
    exit()
elif a[0]-a[1]-a[2]-a[3]==7:
    print(str(a[0])+"-"+str(a[1])+"-"+str(a[2])+"-"+str(a[3])+"=7")
    exit()
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=[]
ans_2=[]
for i in range(n):
    cnt=0
    for j in range(n):
        if a[j]<b[i]:
            cnt+=1
    ans.append(cnt)
for i in range(n):
    cnt_2=0
    for j in range(n):
        if b[i]<c[j]:
            cnt_2+=1
    ans_2.append(cnt_2)
num=0
for i in range(n):
    num+=ans[i]*ans_2[i]
print(num)


Fixed submission:
import bisect
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
c=list(map(int,input().split()))
a.sort()
b.sort()
c.sort()
ans=0
for k in b:
    i=bisect.bisect_left(a,k)
    j=bisect.bisect_right(c,k)
    if 0<i and j!=len(c):
        ans+=i*(n-j)
print(ans)
Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
sl=len(s)
tl=len(t)
for k in range(sl-tl+2):
    judge=True
    for i in range(tl):
        if s[i+k]==t[i] or s[i+k]=="?":
            pass
        else:
            judge=False
            break
    if judge:
        for i in range(tl):
            s[i+k]=t[i]
        for i in range(sl):
            if s[i]=="?":
                s[i]="a"
        print("".join(s))
        exit()
print("UNRESTORABLE")


Fixed submission:
s=list(input())
t=list(input())
sl=len(s)
tl=len(t)
for k in range(sl-tl,-1,-1):
    judge=True
    for i in range(tl):
        if s[i+k]==t[i] or s[i+k]=="?":
            pass
        else:
            judge=False
            break
    if judge:
        for i in range(tl):
            s[i+k]=t[i]
        for i in range(sl):
            if s[i]=="?":
                s[i]="a"
        print("".join(s))
        exit()
print("UNRESTORABLE")

Buggy python submission (verdict: Runtime Error):
s=list(input())
t=list(input())
sl=len(s)
tl=len(t)
for i in range(sl-tl,-1,-1):
    j=0
    while j<tl:
        if s[j+1]==t[j] or s[j+i]=="?":
            j+=1
        else:
            break
    if j==tl:
        for i in range(tl):
            s[i+k]=t[k]
        for j in range(sl):
            if s[j]=="?":
                s[j]="a"
        print("".join(s))
        exit()
print("UNRESTORABLE")


Fixed submission:
s=list(input())
t=list(input())
sl=len(s)
tl=len(t)
for k in range(sl-tl,-1,-1):
    judge=True
    for i in range(tl):
        if s[i+k]==t[i] or s[i+k]=="?":
            pass
        else:
            judge=False
            break
    if judge:
        for i in range(tl):
            s[i+k]=t[i]
        for i in range(sl):
            if s[i]=="?":
                s[i]="a"
        print("".join(s))
        exit()
print("UNRESTORABLE")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=[int(input()) for i in range(n)]
ans=[]
for i in a:
    if i not in ans:
        ans.append(i)
    else:
        ans.remove(i)
print(len(ans))


Fixed submission:
n=int(input())
ans=[]
for i in range(n):
    a=int(input())
    ans.append(a)
from collections import Counter
data=Counter(ans).values()
count=0
for i in data:
    if i%2!=0:
        count+=1
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
count=0
ans=[]
for i in range(min(a),max(a)+1):
    for j in a:
        if j==i or i==j-1 or i==j+1:
            count+=1
    ans.append(count)
    count=0
print(max(ans))

Fixed submission:
n=int(input())
v=list(map(int,input().split()))
ans=[]
for i in range(n):
    ans.append(v[i])
    a=v[i]+1
    ans.append(a)
    b=v[i]-1
    ans.append(b)
from collections import Counter
data=Counter(ans)
print(data.most_common(1)[0][1])
Buggy python submission (verdict: Runtime Error):
s=list(set(input()))
test=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()
i=0
while True:
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1


Fixed submission:
s=list(set(input()))
test=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()

i=0
while True:
    if len(s)<=i:
        print(test[i])
        break
        
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1

Buggy python submission (verdict: Runtime Error):
s=list(set(input()))
test=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()
i=0
while True:
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1


Fixed submission:
s=list(set(input()))
test=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
test.sort()
s.sort()
if len(s)==len(test):
    print("None")
    exit()

i=0
while True:
    if len(s)<=i:
        print(test[i])
        break
        
    if test[i]!=s[i]:
        print(test[i])
        break
    i+=1
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(min(b,d)-max(a,c))


Fixed submission:
n=list(map(int,input()))
re=n[::-1]
for i in range(len(n)):
    if n[i]==re[i]:
        print("Yes")
        break
    else:
        print("No")
        break

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if b<c:
    print(0)
else:
    print(min(b,d)-max(a,c))

Fixed submission:
n=list(map(int,input()))
re=n[::-1]
for i in range(len(n)):
    if n[i]==re[i]:
        print("Yes")
        break
    else:
        print("No")
        break

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
s=max(b,d)-min(a,c)
s_i=(c-a)+(d-b)
if b<c:
    print(0)
else:
    print(s-s_i)

Fixed submission:
n=list(map(int,input()))
re=n[::-1]
for i in range(len(n)):
    if n[i]==re[i]:
        print("Yes")
        break
    else:
        print("No")
        break

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
s=max(b,d)-min(a,c)
s_i=(c-a)+(d-b)
if b<c:
    print(0)
else:
    print(abs(s_i-s))

Fixed submission:
n=list(map(int,input()))
re=n[::-1]
for i in range(len(n)):
    if n[i]==re[i]:
        print("Yes")
        break
    else:
        print("No")
        break

Buggy python submission (verdict: Runtime Error):
n=list(map(int,input().split))
n_re=n.reverse()
if n==n_re:
    print("Yes")
else:
    print("No")


Fixed submission:
n=list(map(int,input()))
re=n[::-1]
for i in range(len(n)):
    if n[i]==re[i]:
        print("Yes")
        break
    else:
        print("No")
        break
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
total=sum(a)
ans=[]
for i in range(n-1):
    x=sum(a[:i+1:])
    ans.append(abs(2*x-total))
print(min(ans))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
v=sum(a)
x=sum(a)
ans=[]
for i in range(n-1):
    x=x-a[i]
    ans.append(abs(v-2*x))
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
total=sum(a)
ans=[]
for i in range(1,n):
    x=sum(a[0:i])
    ans.append(abs(2*x-total))
print(min(ans))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
v=sum(a)
x=sum(a)
ans=[]
for i in range(n-1):
    x=x-a[i]
    ans.append(abs(v-2*x))
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
v=sum(a)
ans=[]
for i in range(1,n):
    x=sum(a[0:i])
    y=v-x
    ans.append(abs(y-x))
print(min(ans))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
v=sum(a)
x=sum(a)
ans=[]
for i in range(n-1):
    x=x-a[i]
    ans.append(abs(v-2*x))
print(min(ans))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
a_sum=sum(a)
array=[]
for i in range(n-1):
    k=sum(a[0:i+1])
    array.append(k)
array_i=[]
for i in range(n-1):
    m=abs(a_sum-(2*array[i]))
    array_i.append(m)
print(min(array_i))


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
v=sum(a)
x=sum(a)
ans=[]
for i in range(n-1):
    x=x-a[i]
    ans.append(abs(v-2*x))
print(min(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n,p=map(int,input().split())
a=list(map(int,input().split()))
cnt=0
for i in range(1<<n):
    total=0
    for j in range(n):
        if i&(1<<j):
            total+=a[j]
    if p==0:
        if total%2==0:
            cnt+=1
    elif p==1:
        if total%2==1:
            cnt+=1
print(cnt)

Fixed submission:
n,p=map(int,input().split())
a=list(map(int,input().split()))
if all(elem %2==0 for elem in a):
    if p==0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
map_b=map(str,b)
v=" ".join(map_b)
print(v)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.reverse()
ans=[]
re_ans=[]
if n==1:
    print(a[0])
else:
    ans=a[::2]
    re_ans=a[1::2]
    re_ans.reverse()
    ans.extend(re_ans)
    map_ans=map(str,ans)
    v=" ".join(map_ans)
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
def test():
    n=int(input())
    a=list(map(int,input().split()))
    b=[]
    for i in range(n):
        b.append(a[i])
        b.reverse()
    return " ".join(map(str,b))
t=test()
print(t)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.reverse()
ans=[]
re_ans=[]
if n==1:
    print(a[0])
else:
    ans=a[::2]
    re_ans=a[1::2]
    re_ans.reverse()
    ans.extend(re_ans)
    map_ans=map(str,ans)
    v=" ".join(map_ans)
    print(v)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=list(map(int,input().split()))
b=[]
for i in range(n):
    b.append(a[i])
    b.reverse()
print(" ".join(map(str,b)))

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
a.reverse()
ans=[]
re_ans=[]
if n==1:
    print(a[0])
else:
    ans=a[::2]
    re_ans=a[1::2]
    re_ans.reverse()
    ans.extend(re_ans)
    map_ans=map(str,ans)
    v=" ".join(map_ans)
    print(v)
Buggy python submission (verdict: Runtime Error):
x,a,b=map(int,input().split())
if b<=a:
    print("delicious")
else:
    pass=b-a
    if pass<=x:
        print("safe")
    else:
        print("dangerous")


Fixed submission:
x,a,b=map(int,input().split())
pass_day=b-a
if b<=a:
    print("delicious")
else:
    if pass_day<=x:
        print("safe")
    else:
        print("dangerous")
Buggy python submission (verdict: Time Limit Exceeded):
import math
n,m=map(int,input().split())
mod=10**9+7
if 2<=abs(n-m):
    print(0)
elif abs(n-m)==1:
    print(math.factorial(n)*math.factorial(m)%mod)
elif n==m:
    print(2*math.factorial(n)*math.factorial(m))

Fixed submission:
import math
mod=10**9+7
n,m=map(int,input().split())
ans=0
if abs(n-m)==0:
    ans=math.factorial(n)*math.factorial(m)*2
elif abs(n-m)==1:
    ans=math.factorial(n)*math.factorial(m)
else:
    ans=0
ans=ans%mod
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=map(int,input().split())
mod=10**9+7
sn=1
sm=1
for i in range(1,n+1):
    sn*=i
for j in range(1,m+1):
    sm*=j
if 2<=abs(n-m):
    print(0)
elif abs(n-m)==1:
    print(sn*sm%mod)
elif n==m:
    print(2*sn*sm%mod)


Fixed submission:
import math
mod=10**9+7
n,m=map(int,input().split())
ans=0
if abs(n-m)==0:
    ans=math.factorial(n)*math.factorial(m)*2
elif abs(n-m)==1:
    ans=math.factorial(n)*math.factorial(m)
else:
    ans=0
ans=ans%mod
print(ans)

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
mod=10**9+7
sn=1
for i in range(n+1):
    sn*=i
for j in range(m+1):
    sm*=j
if 2<=abs(n-m):
    print(0)
elif abs(n-m)==1:
    print(sn*sm)
elif n==m:
    print(2*sn*sm)
    
    

Fixed submission:
import math
mod=10**9+7
n,m=map(int,input().split())
ans=0
if abs(n-m)==0:
    ans=math.factorial(n)*math.factorial(m)*2
elif abs(n-m)==1:
    ans=math.factorial(n)*math.factorial(m)
else:
    ans=0
ans=ans%mod
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=[]
for i in range(n):
    s.append(int(input()))
total=sum(s)
s.sort()
if total%10!=0:
    print(total)
else:
    for i in s:
        if i%10!=0:
            total-=i
            if total%10!=0:
                break
if total%10==0:
    print(0)
else:
    print(total)


Fixed submission:
a,b=map(int,input().split())
if 10<=a+b:
    print("error")
else:
    print(a+b)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
line=[tuple(map(int,input().split()))for i in range(m)]
ans=[]
for i in range(m):
    ans.append(line[i][0])
    ans.append(line[i][1])
from collections import Counter
data=Counter(ans)
data=sorted(data.items())
for i in range(n):
    print(data[i][1])

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

Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
line=[tuple(map(int,input().split()))for i in range(m)]
from collections import Counter
ans=[]
for i in range(m):
    ans.append(line[i][0])
    ans.append(line[i][1])
data=Counter(ans)
data=sorted(data.items())
for i in range(n):
    print(data[i][1])

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