Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
  
  interpools mpzp(input())
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)

Fixed submission:
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
    
    
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
  
  interpools mpzp(int,Input().spli
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)

Fixed submission:
import itertools
 
N, M = map(int, input().split())
lights = []
for m in range(M):
    tmp = list(map(int, input().split()))
    lights.append(tmp[1:])
    
    
 
 
P = list(map(int, input().split()))
 
ans = 0
for product in list(itertools.product([0, 1], repeat=N)):
    for light in range(len(lights)):
        cnt = 0
        for l in lights[light]:
            cnt += product[l-1]
        if cnt % 2 != P[light]:
            break
        if light == len(lights) - 1:
            ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
s = raw_input()

if s[0] == s[len(s)-1]:
    if len(s) % 2 == 0:
        return "First"
    else:
        return "Second"
else:
    if len(s) % 2 == 0:
        return "Second"
    else:
        return "First"
    

Fixed submission:
import sys
s = raw_input()
 
if s[0] == s[len(s)-1]:
    if len(s) % 2 == 0:
        print "First"
    else:
        print  "Second"
else:
    if len(s) % 2 == 0:
        print  "Second"
    else:
        print  "First"
Buggy python submission (verdict: Runtime Error):
X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
   if X[i] = 'T':
      cnt += 1
   else:
      cnt -= 1
   if cnt > cnt_max: 
      cnt_max = cnt

print cnt_max * 2 

Fixed submission:
X = raw_input()
cnt = 0
cnt_max = cnt
L = len(X)

for i in range(L):
   if X[i] == 'T':
      cnt += 1
   else:
      cnt -= 1
      
   if cnt > cnt_max: 
      cnt_max = cnt

print cnt_max * 2

Buggy python submission (verdict: Runtime Error):
X = raw_input()
cnt = 0
cnt_max = cnt
for i in range(len(X)):
   if X[i] = 'T':
      cnt += 1
   else:
      cnt -= 1
   if cnt > cnt_max: 
        cnt_max = cnt

return cnt_max * 2 

Fixed submission:
X = raw_input()
cnt = 0
cnt_max = cnt
L = len(X)

for i in range(L):
   if X[i] == 'T':
      cnt += 1
   else:
      cnt -= 1
      
   if cnt > cnt_max: 
      cnt_max = cnt

print cnt_max * 2
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
for i in range(n):
    dap*=l[i]
    if dap>1000000000000000000:
        nodap++
        break
if nodap:
    print("-1")
else:
    print(dap)

Fixed submission:
n=int(input())
l=list(map(int, input().split()))
dap=1
nodap=0
zeroexist=0
for i in range(n):
    zeroexist+=(l[i]==0)
if zeroexist>0:
    print("0")
else:
    for i in range(n):
        dap*=l[i]
        if dap>1000000000000000000:
            nodap+=1
            break
    if nodap==1:
        print("-1")
    else:
        print(dap)
Buggy python submission (verdict: Runtime Error):
xin = int(input())
	
if ( X >= 30 ):
	print("yes")
else:
	print("no")


Fixed submission:
xin = int(input())
	
if ( xin >= 30 ):
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
import math

x = list(map(int, input()))

print(360*x/gcd(360,x))



Fixed submission:
import math

x = input()
x = int(x)

lcd=(360*x)//math.gcd(360,x)

print(lcd//x)

Buggy python submission (verdict: Runtime Error):
import math

x = list(map(int, input()))

print(360*x/gcd(360,x))



Fixed submission:
import math

x = input()
x = int(x)

lcd=(360*x)//math.gcd(360,x)

print(lcd//x)
Buggy python submission (verdict: Runtime Error):
xin = input().split()
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	if(a.isinteger() and b.isinteger()):
		print("yes")
	else;
		print("no")
else:
	print("no")
	 


Fixed submission:
xin = input().split()
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0] + x[1]/2

if (a>=0 and b>= 0):
	if(a.is_integer() and b.is_integer()):
		print("Yes")
	else:
		print("No")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0]/2 + x[1]/2

if a>=0 and b>= 0:
	print("yes")
else:
	print("no")

Fixed submission:
xin = input().split()
x = list(map(int, xin))

a = x[0]*2 - x[1]/2
b = -x[0] + x[1]/2

if (a>=0 and b>= 0):
	if(a.is_integer() and b.is_integer()):
		print("Yes")
	else:
		print("No")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(x) for x in input().split()]

ans = a[0]
for i in range(1,n):
    ans *= a[i]

if ans > 10**18:
    print(-1)
else:
    print(ans)


Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
lim = 10**18
flag = True

ans = a[0]

if a.count(0) >= 1:
    ans = 0
else:
    for i in range(1,n):
        ans *= a[i]
        if ans > lim:
            flag = False
            break
            
if flag:
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd,numbers)

def main():
    n = int(input())
    ans = 0
    for i in range(1,n+1):
        for j in range(1,n+1):
            for k in range(1,n+1):
                ans += gcd(i,j,k)
    print(ans)

if __name__ == '__main__':
    main()


Fixed submission:
import math
from functools import reduce
n = int(input())
ans = 0
li = []
buf = n

for i in range(1,n+1):
    for j in range(1,n+1):
        tmp = math.gcd(i,j)
        li.append(tmp)
for i in range(len(li)):
    for j in range(1,n+1):
        ans += math.gcd(li[i],j)

print(ans)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
ans = []

for i in range(m):
    s,c = map(int,input().split())
    li.append([s,c])

for i in range(10**(n-1),10**n):
    buf = str(i)
    flag = True
    for j in range(len(li)):
        if buf[li[j][0]-1] != str(li[j][1]):
            flag = False
    if flag:
        ans.append(buf)
        flag = True

ans.sort()
if ans:
    print(ans[0])
else:
    print(-1)


Fixed submission:
n,m = map(int,input().split())
ans = []
li = []

for i in range(m):
    s,c = map(int,input().split())
    li.append([s,c])

if n == 1:
    for i in range(10):
        buf = str(i)
        flag = True
        for j in range(len(li)):
            if buf[li[j][0]-1] != str(li[j][1]):
                flag = False
        if flag:
            ans.append(buf)
            flag = True
else:
    for i in range(10**(n-1),10**n):
        buf = str(i)
        flag = True
        for j in range(len(li)):
            if buf[li[j][0]-1] != str(li[j][1]):
                flag = False
        if flag:
            ans.append(buf)
            flag = True

ans.sort()
if ans:
    print(ans[0])
else:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

max = -1
ans=0


for i in range(0,n-k+2):
    buf = p[i:i+k]
    tmp = sum(buf)
    if tmp > max:
        max = tmp
        li = p[i:i+k]

for j in range(len(li)):
    ans += (1+li[j])/2
    
print(ans)


Fixed submission:
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

li = []
count=0
ans = 0

for i in range(len(p)):
    p[i] += 1
    li.append(p[i])
    if len(li) < k:
        continue
    elif len(li) == k:
        max = sum(li)
        buf = max
    elif len(li) > k:
        tmp = buf - li[count] + li[-1]
        buf = tmp
        if tmp >= max:
            max = tmp
        count+=1

print(max/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

max = -1
ans=0


for i in range(0,n-k+2):
    buf = p[i:i+k]
    tmp = sum(buf)
    if tmp > max:
        max = tmp
        li = p[i:i+k]

for j in range(len(li)):
    s_buf = 0
    for l in range(1,li[j]+1):
        s_buf+=l
    ans += s_buf/li[j]
    s_buf=0

print(ans)


Fixed submission:
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

li = []
count=0
ans = 0

for i in range(len(p)):
    p[i] += 1
    li.append(p[i])
    if len(li) < k:
        continue
    elif len(li) == k:
        max = sum(li)
        buf = max
    elif len(li) > k:
        tmp = buf - li[count] + li[-1]
        buf = tmp
        if tmp >= max:
            max = tmp
        count+=1

print(max/2)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

max = -1
ans=0

for i in range(0,n-k+2):
    buf = p[i:i+k]
    tmp = sum(buf)
    if tmp > max:
        ans=0
        max = tmp
        for j in range(len(buf)):
            s_buf = 0
            for l in range(1,buf[j]+1):
                s_buf+=l
            ans += s_buf/buf[j]
            s_buf=0

print(ans)


Fixed submission:
n,k = map(int, input().split())
p = [int(x) for x in input().split()]

li = []
count=0
ans = 0

for i in range(len(p)):
    p[i] += 1
    li.append(p[i])
    if len(li) < k:
        continue
    elif len(li) == k:
        max = sum(li)
        buf = max
    elif len(li) > k:
        tmp = buf - li[count] + li[-1]
        buf = tmp
        if tmp >= max:
            max = tmp
        count+=1

print(max/2)
Buggy python submission (verdict: Runtime Error):
h,n = map(int,input().split())
waza = sorted([int(x) for x in input().split()],reverce=True)

ans=0

for i in range(n):
    ans+=waza[i]

if ans >= h:
    print("Yes")
else:
    print("No")


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

a=[int(x) for x in input().split()]

flag=False

for aa in a:
    h-=aa
    if h <= 0:
        flag=True
        break
    
if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
p=[int(x) for x in input().split()]


result=0

for pp in p:
    flag=True
    buf=p[0:pp]
    for bb in buf:
        if bb < p[pp-1]:
            flag=False
            break
    if flag==True:
        result+=1
        
print(result)
    

Fixed submission:
n=int(input())
p=[int(x) for x in input().split()]


result=0

mm = 10**11

for pp in p:
    if pp <= mm:
        mm=pp
        result+=1

print(result)

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


flag = True
result=0

for pp in p:
    buf=p[0:pp]
    if min(buf)==p[pp-1]:
        result+=1
        
print(result)
    


Fixed submission:
n=int(input())
p=[int(x) for x in input().split()]


result=0

mm = 10**11

for pp in p:
    if pp <= mm:
        mm=pp
        result+=1

print(result)
Buggy python submission (verdict: Runtime Error):
import sys

n,m=map(int,input().split())

if m==0:
    print(0,0)
    sys.exit()

p=[]
s=[]
for i in range(m):
    pp,ss=input().split()
    p.append(int(pp))
    s.append(ss)

p.append(max(p)+1)

sei=0
pena=0

print(len(p))

i=0

while(True):
    #print(i)
    #print("p[i],p[-1]:",p[i],p[-1])
    if p[i]==p[-1]: break
    if s[i]=='WA':
        pena+=1
    else:
        sei+=1
        #print("p[i]+1:",p[i]+1)
        i=p.index(p[i]+1)-1
        #print("i:",i)
    i+=1
            
print(sei,pena)


Fixed submission:
n,m=map(int,input().split())
ac = [0] * n
wa = [0] * n

for i in range(m):
    p,s = map(str,input().split())
    p = int(p)
    if ac[p-1] != 1:
        if s == 'WA':
            wa[p-1] += 1
        elif s == 'AC':
            ac[p-1] += 1

for i in range(n):
    if ac[i] == 1:
        continue
    elif ac[i] == 0:
        wa[i] = 0
        
print(sum(ac),sum(wa))
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int,input().split())
print(a*b//math.gcd(a,b))


Fixed submission:
import fractions
a,b=map(int, input().split())
print((a*b)//fractions.gcd(a,b))

Buggy python submission (verdict: Runtime Error):
import math
a,b=map(int, input().split())
print((a*b)//math.gcd(a,b))

Fixed submission:
import fractions
a,b=map(int, input().split())
print((a*b)//fractions.gcd(a,b))
Buggy python submission (verdict: Runtime Error):
x = int(input())
tmp = x%100

if x % tmp == 0:
    print(1)
else:
    print(0)


Fixed submission:
x = int(input())
flag = False

for i in range(1,2000):
    if i * 100 <= x <= i * 105:
        flag = True
        break

if flag:
    print(1)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split())

count=0
tmp=0

for i in range(1,21):
    if (a-1)*i+1 >= b:
        print(i)
        break


Fixed submission:
s=input()
t=input()

count = 0

for s,t in zip(s,t):
    if s==t: count+=1

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


def anagrams(word1,word2):
    def counter(s):
        return Counter(s.upper().replace(' ',''))
    return counter(word1) == counter(word2)

N=int(input())

count=0

list=[]

for i in range(N):
    list.append(input())

for i in list:
    list.remove(i)
    if len(list)==2:
        if anagrams(list[0],list[1])==True:
            count+=1
        break
    for j in list:
        if anagrams(i,j)==True:
            count+=1
print(count)

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

tmp1=a+b
tmp2=a-b
tmp3=a*b

list=[tmp1,tmp2,tmp3]

print(max(list))
Buggy python submission (verdict: Runtime Error):
n=int(input())
p=[int(x) for x in input().split()]
pp=[int(x+1) for x in range(n)]

count=0

for i in range(n):
    if p[i]!=pp[i]:
        count+=1

if count <= 2
    print("Yes")
else:
    print("No")

Fixed submission:
n=int(input())
p=[int(x) for x in input().split()]
pp=[int(x+1) for x in range(n)]

count=0

for i in range(n):
    if p[i]!=pp[i]:
        count+=1

if count <= 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())

mn = 4038

if (r - l) >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = (i * j) % 2019
            if tmp < mn:
                mn = tmp
	print(mn)


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

mn = 4038

if (r - l) >= 2019:
    print(0)
else:
    for i in range(l,r):
        for j in range(i+1,r+1):
            tmp = (i * j) % 2019
            if tmp < mn:
                mn = tmp
    print(mn)
Buggy python submission (verdict: Runtime Error):
import math

n=[int(x) for x in input().split()]

a=(n[0]-1)//n[2]
b=(n[0]-1)//n[3]
c=(n[0]-1)//(n[2]*n[3]/math.gcd(n[2],n[3]))

d=n[1]//n[2]
e=n[1]//n[3]
f=n[1]//(n[2]*n[3]/math.gcd(n[2],n[3]))

print((n[1]-d-e+f)-((n[0]-1)-a-b+c))

Fixed submission:
import fractions

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

a-=1

buf_1=a-(a//c+a//d)+a//((c*d)//fractions.gcd(c,d))
buf_2=b-(b//c+b//d)+b//((c*d)//fractions.gcd(c,d))

print(buf_2-buf_1)
Buggy python submission (verdict: Runtime Error):
x,a=map(int,input())

if x < a:
    print(0)
else:
    print(10)


Fixed submission:
n=input().split()

if n[0]<n[1]:
    print('0')
else:
    print('10')
Buggy python submission (verdict: Time Limit Exceeded):
n,q = map(int,input().split())
s = input()
ans = []
for i in range(q):
    l,r = map(int,input().split())
    buf = s[max(0,l-1):r]
    ans.append(buf.count('AC'))

for aa in ans:
    print(aa)


Fixed submission:
n,q = map(int,input().split())
s = input()
ans = []
li = [0] * (len(s))
count = 0

for i in range(1,len(s)):
    if s[i] == 'C' and s[i-1] == 'A':
        count += 1
    li[i] = count

for i in range(q):
    l,r = map(int,input().split())
    tmp = li[r-1] - li[l-1]
    ans.append(tmp)

for aa in ans:
    print(aa)

Buggy python submission (verdict: Runtime Error):
n,q = map(int,input().split())
s = input()
ans = []
for i in range(q):
    l,r = map(int,input().split())
    buf = s[l-1:r]
    print(buf)
    ans.append(buf.count('AC'))

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


Fixed submission:
n,q = map(int,input().split())
s = input()
ans = []
li = [0] * (len(s))
count = 0

for i in range(1,len(s)):
    if s[i] == 'C' and s[i-1] == 'A':
        count += 1
    li[i] = count

for i in range(q):
    l,r = map(int,input().split())
    tmp = li[r-1] - li[l-1]
    ans.append(tmp)

for aa in ans:
    print(aa)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = []
ans = 10**10

for i in range(n):
    h.append(int(input()))
h.sort()

for i in range(n-k+1):
    tmp = h[i:i+k]
    buf = tmp[-1] - tmp[0]
    if buf < ans:
        ans = buf
print(ans)


Fixed submission:
n,k = map(int,input().split())
h = []
ans = 10**10

for i in range(n):
    h.append(int(input()))
h.sort()

for i in range(n-k+1):
    buf = h[i+k-1] - h[i]
    if buf < ans:
        ans = buf
print(ans)
Buggy python submission (verdict: Runtime Error):
N=int(input())

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

min=5000

H=[int(x) for x in input().split()]

for i in range(N):
    #print(abs(A-(T-H[i]*0.006)))
    if abs(A-(T-H[i]*0.006)) <= min:
        min=abs(A-(T-H[i]*0.006))
        buf=i+1

print(buf)

Fixed submission:
x,y=map(int,input().split())

print(x+y//2)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
li=[]
city_counter = [1] * (m+1)
ans=[]

for i in range(m):
    p,y=map(int,input().split())
    li.append((p,y,i))

li.sort(key=lambda x:x[1])

for i in range(len(li)):
    tmp = str(li[i][0]).zfill(6) + str(city_counter[li[i][0]]).zfill(6)
    ans.append((tmp,li[i][2]))
    city_counter[li[i][0]] += 1

ans.sort(key=lambda x:x[1])

for i in range(len(ans)):
    print(ans[i][0])


Fixed submission:
n,m=map(int,input().split())
dic=[]
ans=[]
number=[1] * (10**5+2)

for i in range(m):
    p,y=map(int,input().split())
    dic.append((p,y,i))

dic.sort(key=lambda x:x[1])

for i in range(m):
    tmp=str(dic[i][0]).zfill(6)+str(number[dic[i][0]]).zfill(6)
    number[dic[i][0]]+=1
    ans.append((tmp,dic[i][2]))

ans.sort(key=lambda x:x[1])

for i in range(m):
    print(ans[i][0])
Buggy python submission (verdict: Runtime Error):
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = ss.values().sorted()
t_v = tt.values().sorted()

if s_v == t_v:
    print("Yes")
else:
    print("No")


Fixed submission:
import collections

s=list(input())
t=list(input())

ss=collections.Counter(s)
tt=collections.Counter(t)

s_v = sorted(ss.values())
t_v = sorted(tt.values())

if s_v == t_v:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
import functools
import math

n,x=map(int,input().split())
xx=[int(t) for t in input().split()]
buf=[]

for value in xx:
    buf.append(abs(value - x))

print(functools.reduce(math.gcd, buf))


Fixed submission:
import functools
import fractions

n,x=map(int,input().split())
xx=[int(t) for t in input().split()]
buf=[]

for value in xx:
    buf.append(abs(value - x))

print(functools.reduce(fractions.gcd, buf))
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

ans=0

for i in range(a,b+1):
    buf=str(i)
    #print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])
    str=buf[::-1]
    if buf==str:
        ans+=1

print(ans)

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

ans=0

for i in range(a,b+1):
    buf=str(i)
    #print(buf[0:int(len(buf)/2)],buf[int(len(buf)/2+1):])
    str1=buf[0:int(len(buf)/2)]
    str2=buf[int(len(buf)/2+1):]
    if str1[0]==str2[1] and str1[1]==str2[0]:
        ans+=1

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

N,K=map(int, input().split())
l=[int(x) for x in input().split()]

max=-3

for i in list(itertools.combinations(l,K)):
    if sum(i)>=max:
        max=sum(i)

print(max)

Fixed submission:
N,K=map(int, input().split())
l=[int(x) for x in input().split()]

buf=sorted(l,reverse=True)
result=0

for i in range(K):
    result+=buf[i]

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())

a=[int(x) for x in input().split()]

min=50000000000

for i in range(N-1):
    sunuke=sum(a[0:i+1])
    arai=sum(a[i+1:N])
    if(abs(sunuke-arai)<=min):
        min=abs(sunuke-arai)

print(min)

Fixed submission:
n = int(input())
a = [int(x) for x in input().split()]
sm = sum(a)//2
mn = 10**10
ar = a[0]
su = a[-1]
for i in range(1,len(a)-1):
    if abs(sm - ar) < mn:
        mn = abs(sm - ar)
        mn_i = i
    ar += a[i]

if len(a) > 2:
    ar = sum(a[0:mn_i])
    su = sum(a[mn_i::])
    print(abs(ar-su))
else:
    print(abs(ar-su))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
ans = 1

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

print(ans%(10**9+7))


Fixed submission:
n = int(input())
ans = 1

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

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = [0] * 10050

for x in range(1, 500):
    for y in range(1, 500):
        for z in range(1, 500):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10000:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
ans = [0] * 10050

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10050:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = [0] * 10050

for x in range(1, 1105):
    for y in range(1, 1105):
        for z in range(1, 1105):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10000:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])

Fixed submission:
N = int(input())
ans = [0] * 10050

for x in range(1, 105):
    for y in range(1, 105):
        for z in range(1, 105):

            f = x**2 + y**2 + z**2 + x*y + y*z + z*x

            if f < 10050:
                ans[f-1] = ans[f-1] + 1 


for i in range(N):
    print(ans[i])
Buggy python submission (verdict: Runtime Error):
A, B= input().split()
A = int(A)
B = float(B)
B = B * 100
C = A * B
C = math.floor (C / 100) 
print(int(C))

Fixed submission:
A, B= input().split()
A = int(A)
B = B.replace('.','')
B = int(B)
print(A*B//100)