Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):

n,d = map(int,input().split())
ans = 0
dis = 2*d +1

if (n % d) == 0:
	ans = int(n / dis)
else:
	ans = int()(n // dis)+1)

print(ans)


Fixed submission:

n,d = map(int,input().split())
ans = 0
dis = 2*d +1

if (n % dis) == 0:
	ans = int(n / dis)
else:
	ans = int((n // dis)+1)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = []
for i in range(n):
    a.append(int(input()))

b = []

for i in range(n):
    tmp = a[i]
    del a[i]
    b.append(max(a))
    a.insert(i,tmp)

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


Fixed submission:

n = int(input())
a = [int(input()) for _ in range(n)]
b = a.copy()
b.sort()

for i in range(n):
    if a[i] == b[-1]:
        print(b[-2])
    else:
        print(b[-1])

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = []
for _ in range(n):
    a.append(int(input()))
b = []

for i in range(n):
    b = []
    b = a.copy()
    del b[i]
    print(max(b))


Fixed submission:

n = int(input())
a = [int(input()) for _ in range(n)]
b = a.copy()
b.sort()

for i in range(n):
    if a[i] == b[-1]:
        print(b[-2])
    else:
        print(b[-1])
Buggy python submission (verdict: Runtime Error):

L,R = map(int,input().split())
if R-L >= 2019:
    print(0)
else:
    ans = []
    for i in range(L,R):
        ans.append(i*j*2019)
    print(min(ans))


Fixed submission:
l,r = map(int,input().split())
m = r-l

if m >= 2019:
  print(0)
else:
  cnt = []
  for i in range(l,r):
    for j in range(l+1,r+1):
      cnt.append(i*j%2019)
  print(min(cnt))

Buggy python submission (verdict: Runtime Error):

L,R = map(int,input().split())
if R-L >= 2019:
    print(a)
else:
    ans = []
    for i in range(L,R):
        ans.append(i*j*2019)
    print(min(ans))

    

Fixed submission:
l,r = map(int,input().split())
m = r-l

if m >= 2019:
  print(0)
else:
  cnt = []
  for i in range(l,r):
    for j in range(l+1,r+1):
      cnt.append(i*j%2019)
  print(min(cnt))
Buggy python submission (verdict: Runtime Error):

import math
a,b,c,d = map(int,input().split())

#cとdの最小公倍数を求める(lcm = least common multiple)
lcm (c*d)/math.gcd(c,d)

ac = (A-1) // c
ad = (A-1) // d

bc = b // c
bd = b // d

ae = (A-1) // lcm
be = b // lcm

s = bc - ac
t = bd - ad
u = be - ae

print(b-a+1-s-t+u)

Fixed submission:

import math,fractions
A,B,C,D=map(int,input().split())
E=C*D//fractions.gcd(C,D)

ac=(A-1)//C
ad=(A-1)//D
bc=B//C
bd=B//D
ae=(A-1)//E
be=B//E

s= bc-ac
t= bd-ad
u= be-ae

print(B-A+1 - s -t +u)
Buggy python submission (verdict: Runtime Error):

n = int(input())
sp = [list(input().split())+[i+1] for i in range(n)]
sp = [[s,-int(p),i] for s,p,i in sp]

sp.sort()
print(sp)

for i in sp:
  print(sp[i][2])

"""
from operator import itemgetter

n = int(input())
l = []

for i in range(n):
    s,p = map(str,input().split())
    p = int(p)
    l.append([s,p,i+1])

l.sort(key = itemgetter(0))
l = sorted(l, key = lambda x:(x[1]),reverse = True)
print(l)
"""


Fixed submission:

n = int(input())
sp = [list(input().split())+[i+1] for i in range(n)]
sp = [[s,-int(p),i] for s,p,i in sp]

sp.sort()

for s,p,i in sp:
    print(i)

"""
from operator import itemgetter

n = int(input())
l = []

for i in range(n):
    s,p = map(str,input().split())
    p = int(p)
    l.append([s,p,i+1])

l.sort(key = itemgetter(0))
l = sorted(l, key = lambda x:(x[1]),reverse = True)
print(l)
"""

Buggy python submission (verdict: Runtime Error):

n = int(input())
a = ""
b = 0
l = []

for i in range(1,n+1):
    a,b = map(str,input().split())
    b = int(b)
    l.append([a,b,i])
l.sort()

pprint.pprint(l)

for i in range(n):
    print(l[i][2])


Fixed submission:

n = int(input())
sp = [list(input().split())+[i+1] for i in range(n)]
sp = [[s,-int(p),i] for s,p,i in sp]

sp.sort()

for s,p,i in sp:
    print(i)

"""
from operator import itemgetter

n = int(input())
l = []

for i in range(n):
    s,p = map(str,input().split())
    p = int(p)
    l.append([s,p,i+1])

l.sort(key = itemgetter(0))
l = sorted(l, key = lambda x:(x[1]),reverse = True)
print(l)
"""
Buggy python submission (verdict: Runtime Error):

n = int(input())
s = list(input())
k = int(input())

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".jpin(s))


Fixed submission:

n = int(input())
s = list(input())
k = int(input())

a = s[k-1]

for i in range(n):
    if s[i] != a:
        s[i] = "*"
print("".join(s))
Buggy python submission (verdict: Runtime Error):

a = [int(input()) for _ in range(5)]
b = []
for i in range(len(a)):
    if a[i] % 10 == 0:
        b.append(0)
    else:
        b.append(10 - (a[i] % 10))
        c = b.index(max(b))

ans = 0
for i in range(5):
    if i !=c:
        if a[i] % 10 == 0:
            ans += a[i]
        else:
            ans += ((a[i] // 10) + 1) * 10
print(ans+a[c])



Fixed submission:

from itertools import permutations

dishes = [int(input()) for _ in range(5)]

minT = 10000
for sample in permutations(dishes, 5):
    t = 0
    for dish in sample:
        if t%10 != 0:
            t += 10 - t%10
        t += dish
    minT = min(minT, t)
print(minT)
Buggy python submission (verdict: Runtime Error):

n = int(input())
l = [int(input()) for i in range(n)]

x = min(l)
print((int(n/x)+1) + 4)


Fixed submission:

n = int(input())
l = []
for _ in range(5):
    l.append(int(input()))

x = min(l)

if n % x == 0:
    print(n // x + 4)
else:
    print(n // x + 5)
Buggy python submission (verdict: Runtime Error):

n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[1]))

for j in range(len(count)):
    ans *= (count[i] + 1)
print(ans-1)


Fixed submission:

n = int(input())
s = list(input())
t = []
ans = 1
count= []

t = set(s)
t = list(t)

for i in range(len(t)):
    count.append(s.count(t[i]))

for j in range(len(count)):
    ans *= (count[j] + 1)

print((ans-1)%(10**9 + 7))
Buggy python submission (verdict: Runtime Error):

a,b,k = map(int,input().split())
c = min(a,b)
t = []

for i in range(1,c):
    if a % i == 0 and b % i == 0:
        t.append(i)
print(t[1])




Fixed submission:

a,b,k = map(int,input().split())
l = []
c = min(a,b)
d = max(a,b)

for i in range(1,c+1):
    if c % i == 0 and d % i == 0:
        l.append(i)

#print(l)
print(l[-k])
Buggy python submission (verdict: Runtime Error):

s = list(int(input()))

if (s[5]*10 + s[6]) <= 4 and (s[8]*10 + s[9]) <=30:
    print("Heisei")
else:
    print("TBD")


Fixed submission:

s = list(input())

if (int(s[5])*10 + int(s[6])) <= 4 and (int(s[8])*10 + int(s[9])) <=30:
    print("Heisei")
else:
    print("TBD")
Buggy python submission (verdict: Runtime Error):

n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(1,a[0]+1):
        t[a[j]] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)





Fixed submission:

n,m = map(int,input().split())
ans = [0] * m
info = []

for i in range(n):
    info = list(map(int,input().split()))
    for j in range(1,info[0]+1):
        ans[info[j]-1] += 1
#    print(ans)

print(ans.count(n))

Buggy python submission (verdict: Runtime Error):

n,m = map(int,input().split())
t = [0]*m
s = []

for i in range(n):
    a = list(map(int,input().split()))
    for j in range(a[0]):
        t[a[j]] += 1

count = 0

for i in range(len(t)):
    if t[i] == n:
        count += 1

print(count)





Fixed submission:

n,m = map(int,input().split())
ans = [0] * m
info = []

for i in range(n):
    info = list(map(int,input().split()))
    for j in range(1,info[0]+1):
        ans[info[j]-1] += 1
#    print(ans)

print(ans.count(n))
Buggy python submission (verdict: Runtime Error):

a,b,c = map(int,input().split())

printint(((a*b*c)/2))


Fixed submission:

a,b,c = map(int,input().split())

print(int(((a*b)/2)))
Buggy python submission (verdict: Runtime Error):

d = input()

if d == "25":
    print("Christmas")
elif d == "24":
    print("Christmas Eve")
elif d == "23":
    print("Christmas Eve Eve")
    elif d == "22"
    print("Christmas Eve Eve Eve")


Fixed submission:

d = input()

if d == "25":
    print("Christmas")
elif d == "24":
    print("Christmas Eve")
elif d == "23":
    print("Christmas Eve Eve")
elif d == "22":
    print("Christmas Eve Eve Eve")
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000000)
INF=10**9
n,a,b,c=map(int,input().split())
l=[int(input()) for i in range(n)]
def dfs(i,x,y,z):
    if i==n:
        if min(x,y,z)>0:
            return abs(x-a)+abs(y-b)+abs(z-c)-30
        else:
            return INF
    ans=dfs(i+1,x,y,z)
    ant=dfs(i+1,x+l[i],y,z)+10
    anu=dfs(i+1,x,y+l[i],z)+10
    anv=dfs(i+1,x,y,z+l[i])+10
    return min(ans,ant,anu,anv)
print(dfs(0,0,0,0))


Fixed submission:

n,k = map(int,input().split())
h = [int(input()) for _ in range(n)]
h.sort()

t = []

for i in range(n-k+1):
    t.append(h[i+k-1]-h[i])
print(min(t))
Buggy python submission (verdict: Runtime Error):

n = input()
ans = ""

for i in range(n):
    if n[i] == 1:
        ans += "9"
    else:
        ans += "1"
print(int(ans))


Fixed submission:

n = input()
ans = ""

for i in range(len(n)):
    if n[i] == "1":
        ans += "9"
    else:
        ans += "1"
print(int(ans))
Buggy python submission (verdict: Runtime Error):

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

#ユークリッド互除法
def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y,x%y)

ans = l[0]
for i in range(1,n):
    ans = gcd(l[i],ans)
print(ans)

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

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

ans=new_lst[0]
for i in range(1,n):
	ans =gcd(new_lst[i],ans)

print(ans)

Buggy python submission (verdict: Runtime Error):

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

#ユークリッド互除法
def gcd(x,y):
    if y == 0:
        return
    else:
        return gcd(y,x%y)

ans = l[0]
for i in range(1,n):
    ans = gcd(l[i],ans)
print(ans)

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

def gcd(x,y):
    if y==0:
        return x
    else:
        return gcd(y,x%y)

ans=new_lst[0]
for i in range(1,n):
	ans =gcd(new_lst[i],ans)

print(ans)
Buggy python submission (verdict: Runtime Error):

n,i = map(int(input().split()))
print((n-i)+1)


Fixed submission:

n,i = map(int,input().split())
print((n-i)+1)
Buggy python submission (verdict: Runtime Error):

r = int(input())

if r < 1200:
    print("ABC")
elif r 2800:
    print("ARC")
else:
    print("AGC")


Fixed submission:

r = int(input())

if r < 1200:
    print("ABC")
elif r < 2800:
    print("ARC")
else:
    print("AGC")
Buggy python submission (verdict: Runtime Error):

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

print(ans(a[3]-a[1]))


Fixed submission:

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

print(abs(a[2]-a[0]))
Buggy python submission (verdict: Runtime Error):

n = int(input())
s = input()

ans = 0

for i in range(1, n):
    h = s[:i]
    t = s[i:]
    cnt = 0
    for j in range(26):
        c = chr(ord('a') + j)
        if c in head and c in tail:
            cnt += 1

    ans = max(ans, cnt)

print(ans)


Fixed submission:
n = int(input())
s = input()

ans = 0
for i in range(1, n):
    head = s[:i]
    tail = s[i:]
    cnt = 0
    for i in range(26):
        c = chr(ord('a') + i)
        if c in head and c in tail:
            cnt += 1

    ans = max(ans, cnt)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(n):
    for j in range(i+1,n+1):
        t = a.copy()
        tmp = t[i:j]
 #       print(tmp)
        if sum(tmp) == 0:
            ans += 1

print(ans)




Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]
for i in range(n):
  b.append(b[-1]+a[i])
#print(b)
ans = 0
b.sort()
for i in range(n+1):
  if i == 0:
    x=b[0]
    m=1
  else:
    if x==b[i]:
      m+=1
      if i==n:
        ans += m*(m-1)//2
    else:
      if m!=1:
        ans += m*(m-1)//2
        m=1
      x=b[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = list(map(int,input().split()))
ans = 0
b = []

for i in range(n):
    for j in range(i+1,n+1):
        b = a[i:j]
#        print(b)

        if sum(b) == 0:
            ans += 1

print(ans)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]
for i in range(n):
  b.append(b[-1]+a[i])
#print(b)
ans = 0
b.sort()
for i in range(n+1):
  if i == 0:
    x=b[0]
    m=1
  else:
    if x==b[i]:
      m+=1
      if i==n:
        ans += m*(m-1)//2
    else:
      if m!=1:
        ans += m*(m-1)//2
        m=1
      x=b[i]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
a = list(map(int,input().split()))
ans = 0
b = []

for i in range(n):
    for j in range(i+1,n+1):
        b = a[i:j]
#        print(b)

        if sum(b) == 0:
            ans += 1

print(ans)


Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]
for i in range(n):
  b.append(b[-1]+a[i])
#print(b)
ans = 0
b.sort()
for i in range(n+1):
  if i == 0:
    x=b[0]
    m=1
  else:
    if x==b[i]:
      m+=1
      if i==n:
        ans += m*(m-1)//2
    else:
      if m!=1:
        ans += m*(m-1)//2
        m=1
      x=b[i]
print(ans)
Buggy python submission (verdict: Runtime Error):

a,b,k = map(int,input().split())
l = [i for i in range(a,b+1)]
ans = []

for i in range(k):
    ans.append(l[i])
    ans.append(l[(i+1)*(-1)])
ans = set(ans)
ans = list(ans)
ans.sort()
for i in range(len(ans)):
    print(ans[i])


Fixed submission:

a,b,k = map(int,input().split())
ans = []

for i in range(k):
    if a + i > b:
        break
    ans.append(a+i)

#print(ans)
for j in range(k):
    if b-j<a:
        break
    ans.append(b-j)
v = set(ans)
w = list(v)
w.sort()
#print(w)

for l in w:
    print(l)
Buggy python submission (verdict: Runtime Error):

a,b = inut().split()
ab = int(a+b)

print("Yes" if ab%(ab**0.5)==0 else "No")


Fixed submission:

a,b = input().split()
ab = int(a+b)

print("Yes" if ab%(ab**0.5)==0 else "No")
Buggy python submission (verdict: Runtime Error):
2
6 8
3 3

Fixed submission:

n = int(input())
ans = 0

for i in range(n):
    l,r = map(int,input().split())
    ans += r-l+1

print(ans)
Buggy python submission (verdict: Runtime Error):

n = input()

if n(0) == n(-1):
    print("Yes")
else:
    print("No")


Fixed submission:

n = input()

if n[0] == n[-1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

N,K = map(int,input().split())
l = list(map(int,input().split()))

k = sorted(l)

print(k[-1] + k[-2] + k[-3])


Fixed submission:

N,K = map(int,input().split())
l = list(map(int,input().split()))

k = sorted(l)

ans = 0

for i in range(K):
    ans += k.pop()

print(ans)
Buggy python submission (verdict: Runtime Error):

n = int(input())
a = list(map(int,input().split()))
ans = 0
b = []

for i in range(n):
    for j in range(i+1,n+1):
        b = a[i:j]
#        print(b)

        if sum(b) == 0:
            ans += 1

print(ans)


Fixed submission:

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

num = 0
count = 0

for i in range(n):
    if a[i] % 2 == 0:
        count += 1

if count == n:
    if p == 0:
        print(2**n)
    elif p == 1:
        print(0)
else:
    print(2**(n-1))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
a.sort()
b = [0]*8
over = 0

for i in a:
    if i < 400:
        b[0] += 1
    elif i < 800:
        b[1] += 1
    elif i < 1200:
        b[2] += 1
    elif i < 1600:
        b[3] += 1
    elif i < 2000:
        b[4] += 1
    elif i < 2400:
        b[5] += 1
    elif i < 2800:
        b[6] += 1
    elif i < 3200:
        b[7] += 1
    else:
        over += 1

#bの中で、０ではない要素数をカウントする
low = 0
for i in b:
    if i >= 0:
        low += 1

if low == 0:
    mini = 1
else:
    mn = low
mx = c + over
print(mini,mx)


Fixed submission:
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0 for i in range(9)]
red = 0
for i in a:
	if i < 400:
		b[0] += 1
	elif i < 800:
		b[1] += 1
	elif i < 1200:
		b[2] += 1
	elif i < 1600:
		b[3] += 1
	elif i < 2000:
		b[4] += 1
	elif i < 2400:
		b[5] += 1
	elif i < 2800:
		b[6] += 1
	elif i < 3200:
		b[7] += 1
	else:
		red += 1
c = 0
for i in b:
	if i > 0:
		c += 1
if c == 0:
	mn = 1
else:
	mn = c
mx = c + red
print (mn, mx)
Buggy python submission (verdict: Runtime Error):

h,w = map(int,input().split())
s = [input() for i in range(h)]

print("#" * (w + 2)
for i in range(h):
    print("#" + s[i] + "#")
print("#" * (w + 2))


Fixed submission:

n,m=map(int,input().split())
s=[input() for i in range(n)]

print("#"*(m+2))
for i in range(n):
  print("#"+s[i]+"#")
print("#"*(m+2))

Buggy python submission (verdict: Runtime Error):

h,w = map(int,input().split())
s = [input() for i in range(h)]

print("#" * w + 2)
for i in range(h):
    print("#" + s[i] + "#")
print("#" * w + 2)


Fixed submission:

n,m=map(int,input().split())
s=[input() for i in range(n)]

print("#"*(m+2))
for i in range(n):
  print("#"+s[i]+"#")
print("#"*(m+2))
Buggy python submission (verdict: Runtime Error):

n,m = map(int,input().split())
s = [[0]*n for _ in range(n)]

for _ in range(m):
    a,b = map(int,input().split())
#    print(a,b)
    s[a-1][b-1] += 1
    s[b-1][a-1] += 1
#    print(s)

for i in range(n):
    print(sum(s[i]))

"""
以下の指定では、一度の値変更で、全ての要素の該当部分の数値が一斉に変わる。
http://delta114514.hatenablog.jp/entry/2018/01/02/233002
n,m = map(int,input().split())
s = [[0]*n]*n
"""


Fixed submission:
a,b,c = map(int,input().split())
if a<= c <= b:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):

n,k = map(int,input().split())
count = [0]* (10**5+1)
s = set()

for i in range(n):
    a,b = map(int,input().split())
    count[a-1] += b
    s.add(a)
print(s)

x = 0
for s in sorted(S):
    x += count[s-1]
    if x >= k:
        print(s)
        break


Fixed submission:
N, K = map(int, input().split())
cnt = [0]*100001
S = set()
for i in range(N):
  a, b = map(int, input().split())
  cnt[a-1] += b
  S.add(a)

acc = 0
for s in sorted(S):
  acc += cnt[s-1]
  if acc >= K:
    print(s)
    break
Buggy python submission (verdict: Runtime Error):

o = list(input())
e = list(input())
ans = []

count = 0

for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
if len(o) != len(e):
    ans.append(e[-1])

print("".join(ans))


Fixed submission:

o = list(input())
e = list(input())
ans = []

count = 0

if len(o) > len(e):
    for i in range(len(e)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(o[-1])
elif len(o) < len(e):
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])
    ans.append(e[-1])
else:
    for i in range(len(o)):
        ans.append(o[i])
        ans.append(e[i])

print("".join(ans))
Buggy python submission (verdict: Runtime Error):

n = int(input())
s = [input() for _ in range(n)]
t = []
for i in range()



from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)


Fixed submission:

from collections import Counter

N = int(input())
S = [input() for _ in range(N)]
cl = [Counter(s) for s in S]

ans = ""
for i in range(26):
  s = chr(ord("a")+i)
  val = min([c[s] for c in cl])
  ans += s*val
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
ans = 10

def fun(a,b):
    if len(str(a)) <= len(str(b)):
        return(len(str(b)))
    else:
        return(len(str(a)))

#print(fun(125,80))


for i in range(1,n+1):
    if n % i == 0:
#        print(i,int(n/i))
        if ans > fun(i,int(n/i)):
            ans = fun(i,int(n/i))
#            print(ans)

print(ans)


Fixed submission:

import math
n = int(input())
ans = 10

def fun(a,b):
    if len(str(a)) <= len(str(b)):
        return(len(str(b)))
    else:
        return(len(str(a)))

#print(fun(125,80))

b =int(math.sqrt(n+1) // 1) + 1
#print(b)

for i in range(1,b):
    if n % i == 0:
#        print(i,int(n/i))
        if ans > fun(i,int(n/i)):
            ans = fun(i,int(n/i))
#            print(ans)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
ans = 1
mod = 10**9 + 7

for i in range(1,n+1):
    ans *= i

print(ans % mod)


Fixed submission:

n = int(input())
ans = 1

for i in range(1,n+1):
    ans *= i
    ans = ans % (10**9 + 7)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
mod = 10 ** 9 + 7
ans = 1

for i in range(1,n+1):
    ans *= i

print(ans % mod)


Fixed submission:

n = int(input())
ans = 1

for i in range(1,n+1):
    ans *= i
    ans = ans % (10**9 + 7)

print(ans)

Buggy python submission (verdict: Runtime Error):

n = int(input())
power = 1

for i in range(1,n+1):
    power *= i
    ans = ans % (10**9 + 7)

print(ans)


Fixed submission:

n = int(input())
ans = 1

for i in range(1,n+1):
    ans *= i
    ans = ans % (10**9 + 7)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):

n = int(input())
power = 1

for i in range(1,n+1):
    power *= i

#print(power)
print(power % (10**9 + 7))


Fixed submission:

n = int(input())
ans = 1

for i in range(1,n+1):
    ans *= i
    ans = ans % (10**9 + 7)

print(ans)
Buggy python submission (verdict: Runtime Error):

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

count = 0

for x in range(l[0] + 1):
    for y in range(l[0] + 1):
        for z in range(l[0] + 1):
            if x + y + z == l[1]:
                count += 1
                print(x,y,z)

print(count)



Fixed submission:

a,b,c = input().split(",")
print(a + " " + b + " " + c)
Buggy python submission (verdict: Time Limit Exceeded):

k,s = map(int,input().split())
a,b,c = 0,0,0
count= 0

for i in range(k+1):
    for j in range(k+1):
        for l in range(k+1):
            if i + j + l == s:
                count += 1
print(count)


Fixed submission:
k,s = map(int,input().split())
count = 0
for i in range(k+1):
  for m in range(k+1):
    if 0 <= s-i-m <= k:
      count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):

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

count = 0

for x in range(l[0] + 1):
    for y in range(l[0] + 1):
        for z in range(l[0] + 1):
            if x + y + z == l[1]:
                count += 1

print(count)


Fixed submission:
k,s = map(int,input().split())
count = 0
for i in range(k+1):
  for m in range(k+1):
    if 0 <= s-i-m <= k:
      count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):

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

count = 0

for x in range(l[0] + 1):
    for y in range(l[0] + 1):
        for z in range(l[0] + 1):
            if x + y + z == l[1]:
                count += 1

print(count)


Fixed submission:
k,s = map(int,input().split())
count = 0
for i in range(k+1):
  for m in range(k+1):
    if 0 <= s-i-m <= k:
      count += 1
print(count)
Buggy python submission (verdict: Runtime Error):

l = ["a","b","c","d","e"]
c = input()

if c in l:
    print("vowel")
else:
    prin("consonant")


Fixed submission:

l = ["a","e","i","o","u"]
c = input()

if c in l:
    print("vowel")
else:
    print("consonant")