Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
def convertListToStr(lst):
	s = "".join(lst)
	return s

N=int(input())
dict={}
ans=0
for i in range(N):
	s = convertListToStr(sorted(input()))
	for check in dict:
		if check==s:
			ans+=dict[check]
			dict[check]+=1
			break
	else:
		dict[s]=1
print(ans)

Fixed submission:
N=int(input())
S = ["".join(sorted(input())) for _ in range(N)]
d={}
ans=0
for s in S:
	if s in d:
		ans+=d[s]
		d[s]+=1
	else:
		d[s]=1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
check_lst=[]
ans=0
for i in range(N):
	check_lst.append([0]*26)
for i in range(N):
	s = input()
	for c in s:#a=97, z=122
		check_lst[i][ord(c)-97]+=1
for i in range(N-1):
	for j in range(i+1,N):
		if check_lst[i]==check_lst[j]:
			ans+=1
print(ans)

Fixed submission:
N=int(input())
S = ["".join(sorted(input())) for _ in range(N)]
d={}
ans=0
for s in S:
	if s in d:
		ans+=d[s]
		d[s]+=1
	else:
		d[s]=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
lst = []
cnt = 0
for i in range(n):
    a = list(map(int, input().split()))
    print(a)
    lst.append(a)
for i in range(n-1):
    for j in range(i+1, n):
        val = 0
        for k in range(d):
            x += (lst[i][k]-lst[j][k]) ** 2
        dist = x ** 0.5
        if dist%1 == 0:
            if dist != 0:
                cnt += 1
print(cnt)

Fixed submission:
from math import sqrt
n, d = map(int, input().split())
lst = []
cnt = 0
for i in range(n):
    a = tuple(map(int, input().split()))
    lst.append(a)
for i in range(n-1):
    for j in range(i+1, n):
        x = 0
        for k in range(d):
            x += (lst[i][k]-lst[j][k])**2
        length = sqrt(x)
        if length%1 == 0:
            if length != 0:
                cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n, d = map(int, input().split())
x = []
cnt = 0
for i in range(n):
    a = list(map(int, input().split()))
    print(a)
    lst.append(a)
for i in range(n-1):
    for j in range(i+1, n):
        val = 0
        for k in range(d):
            x += (lst[i][k]-lst[j][k]) ** 2
        dist = x ** 0.5
        if dist%1 == 0:
            if dist != 0:
                cnt += 1
print(cnt)

Fixed submission:
from math import sqrt
n, d = map(int, input().split())
lst = []
cnt = 0
for i in range(n):
    a = tuple(map(int, input().split()))
    lst.append(a)
for i in range(n-1):
    for j in range(i+1, n):
        x = 0
        for k in range(d):
            x += (lst[i][k]-lst[j][k])**2
        length = sqrt(x)
        if length%1 == 0:
            if length != 0:
                cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
import itertools
L,R=map(int,input().split())
ans=2019
for c in itertools.combinations(range(L,R+1),2):
	if (c[0]*c[1])%2019==0:
		print(0)
		exit()
	else:
		ans=min(ans,(c[0]*c[1])%2019)
print(ans)

Fixed submission:
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	if i==2019:
		print(0)
		exit()
	for j in range(i+1, R+1):
		if j==2019:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Fixed submission:
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
L,R=map(int,input().split())
if L%2019==0 or R%2019==0:
	ans=0
else:
	L%=2019
	R%=2019
	INF=10*9
	ans=INF
	for i in itertools.combinations(range(L,R+1),2):
		ans=min(ans,(i*j)%2019)
print(ans)

Fixed submission:
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Buggy python submission (verdict: Runtime Error):
import itertools
L,R=map(int,input().split())
ans=2019
for i in itertools.combinations(range(L,R+1),2):
	ans=min(ans,(i[0]*i[1])%2019)
print(ans)

Fixed submission:
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
L,R=map(int,input().split())
#print(L,R)
ans=2019
for i in range(L,R):
	for j in range(i+1,R+1):
		ans=min(ans,(i*j)%2019)
print(ans)


Fixed submission:
L,R=map(int,input().split())
ans=2019
for i in range(L,R):
	for j in range(i+1, R+1):
		if j%2019==0:
			print(0)
			exit()
		ans=min(ans,(i*j)%2019)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
l = list(map(int, input().split()))
d = 0
cnt = 0
i = 0
while d <= x:
    cnt += 1
    d += l[i]
    i += 1
print(cnt)

Fixed submission:
n, x = map(int, input().split())
L = list(map(int, input().split()))
d = 0
bound = 1
for l in L:
	d = d + l
	if d > x:
		break
	bound += 1
print(bound)

Buggy python submission (verdict: Runtime Error):
n, x = map(int, input().split())
L = list(map(int, input().split()))
d = 0
bound = 1
for l in L:
	d += l
	if d > X:
		break
	bound += 1
print(bound)

Fixed submission:
n, x = map(int, input().split())
L = list(map(int, input().split()))
d = 0
bound = 1
for l in L:
	d = d + l
	if d > x:
		break
	bound += 1
print(bound)
Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
mod=10**9+7
#Dynamic Programming
dp=[0]*(N+1)
dp[0]=1
if 1 not in a:
	dp[1]=1
else:
	dp[1]=0
for i in range(2,N+1):
	if i in a:
		continue
	dp[i]=(dp[i-1]+dp[i-2])%mod
print(dp[N])

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+1)
dp[0]=1
mod=10**9+7
a=[False for _ in range(N+1)]
for _ in range(M):
    a[int(input())]=True
    
for i in range(1,N+1):
    if a[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod
 
print(dp[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
mod=10**9+7
#Dynamic Programming
dp=[0]*(N+1)
dp[0]=1
if 1 not in a:
	dp[1]=1
else:
	dp[1]=0
for i in range(2,N+1):
	if i in a:
		continue
	dp[i]=(dp[i-1]+dp[i-2])%mod
print(ans)

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+1)
dp[0]=1
mod=10**9+7
a=[False for _ in range(N+1)]
for _ in range(M):
    a[int(input())]=True
    
for i in range(1,N+1):
    if a[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod
 
print(dp[N])

Buggy python submission (verdict: Runtime Error):
N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
mod=10**9+7
#Dynamic Programming
dp=[0]*(N+1)
dp[0]=1
if 1 not in a:
	dp[1]=1
else:
	dp[1]=0
for i in range(2,N+1):
	if i in a:
		continue
	else:
		dp[i]=dp[i-1]+dp[i-2]%mod
print(ans)

Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+1)
dp[0]=1
mod=10**9+7
a=[False for _ in range(N+1)]
for _ in range(M):
    a[int(input())]=True
    
for i in range(1,N+1):
    if a[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod
 
print(dp[N])

Buggy python submission (verdict: Time Limit Exceeded):
N,M=map(int,input().split())
a=[int(input()) for _ in range(M)]
mod=10**9+7
dp=[0]*(N+1)
dp[0]=1
if 1 not in a:
	dp[1]=1
else:
	dp[1]=0
for i in range(2,N+1):
	if i in a:
		continue
	else:
		dp[i]=dp[i-1]+dp[i-2]
ans=dp[N]%mod
print(ans)


Fixed submission:
N,M=map(int,input().split())
dp=[0]*(N+1)
dp[0]=1
mod=10**9+7
a=[False for _ in range(N+1)]
for _ in range(M):
    a[int(input())]=True
    
for i in range(1,N+1):
    if a[i]:
        continue
    dp[i]=(dp[i-1]+dp[i-2])%mod
 
print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
N,Q=map(int,input().split())
S=input()
A=[0]*N
for i in range(1,N+1):
	if S[i-1:i+1]=="AC":
		A[i]+=1
for i in range(Q):
	l,r=map(int,input().split())
	print(sum(A[l:r]))

Fixed submission:
N,Q=map(int,input().split())
S=input()
A=[0]*N
for i in range(1,N+1):
	if S[i-1:i+1]=="AC":
		A[i]+=1
for i in range(1,N):
	A[i]=A[i]+A[i-1]
for i in range(Q):
	l,r=map(int,input().split())
	print(A[r-1]-A[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
text = input()
cnt = 0
for i in range(q):
    l, r = map(int, input().split())
    target = text[l-1:r]
    print(target.count("AC"))

Fixed submission:
N,Q=map(int,input().split())
S=input()
A=[0]*N
for i in range(1,N+1):
	if S[i-1:i+1]=="AC":
		A[i]+=1
for i in range(1,N):
	A[i]=A[i]+A[i-1]
for i in range(Q):
	l,r=map(int,input().split())
	print(A[r-1]-A[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n, q = map(int, input().split())
text = input()
cnt = 0
for i in range(q):
    l, r = map(int, input().split())
    target = text[l-1:r]
    for j in range(len(target)-1):
        if target[j]+target[j+1] == "AC":
            cnt += 1
    print(cnt)
    cnt = 0

Fixed submission:
N,Q=map(int,input().split())
S=input()
A=[0]*N
for i in range(1,N+1):
	if S[i-1:i+1]=="AC":
		A[i]+=1
for i in range(1,N):
	A[i]=A[i]+A[i-1]
for i in range(Q):
	l,r=map(int,input().split())
	print(A[r-1]-A[l-1])
Buggy python submission (verdict: Runtime Error):
from math import gcd as gcd
n=int(input())
a=sorted(map(int,input().split()))
INF=2*10**9
ans=INF
for i in range(len(a)-1):
	tmp=gcd(a[i],a[i+1])
	if tmp!=0 and tmp<ans:
		ans=tmp
print(ans)

Fixed submission:
def gcd(_a, _b):
	if _a%_b==0:return _b
	else:return gcd(_b, _a%_b)

n=int(input())
a=sorted(map(int,input().split()))
INF=2*10**9
ans=INF
for i in range(len(a)-1):
	tmp=gcd(a[i],a[i+1])
	if tmp!=0 and tmp<ans:
		ans=tmp
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
INF=2*10**9
ans=INF
for i in range(n-k+1):
	diff=max(h[i:i+k])-min(h[i:i+k])
	if ans>diff:
		ans=diff
print(ans)

Fixed submission:
n,k=map(int,input().split())
h=[int(input()) for _ in range(n)]
h.sort()
INF=2*10**9
ans=INF
for i in range(n-k+1):
	diff=h[i+k-1]-h[i]
	if ans>diff:
		ans=diff
		if ans==0:
			print(0)
			exit()
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
dict={}
dict2={}
n,m=map(int,input().split())
for i in range(m):
	p,m=map(int,input().split())
	dict[i]=[p,m]
	if p not in dict2:
		dict2[p]=[m]
	else:
		dict2[p].append(m)
for d in dict:
	a='{:0=6}'.format(dict[d][0])
	c=sorted(dict2[dict[d][0]]).index(dict[d][1])+1
	c='{:0=6}'.format(c)
	print(a+c)

Fixed submission:
n,m=map(int,input().split())
pys=[0]*m
for i in range(m):
	p,y=map(int,input().split())
	pys[i]=(p,y,i)
pys.sort(key=lambda x:x[1])

num=[0]*n
ans=[0]*m
for p,y,i in pys:
	num[p-1]+=1
	ans[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)

for a in ans:
	print(a)

Buggy python submission (verdict: Time Limit Exceeded):
dict={}
dict2={}
n,m=map(int,input().split())
for i in range(m):
	p,m=map(int,input().split())
	dict[i]=[p,m]
	if p not in dict2:
		dict2[p]=[m]
	else:
		dict2[p].append(m)
		dict2[p].sort()
for d in dict:
	a='{:0=6}'.format(dict[d][0])
	c=dict2[dict[d][0]].index(dict[d][1])+1
	c='{:0=6}'.format(c)
	print(a+c)

Fixed submission:
n,m=map(int,input().split())
pys=[0]*m
for i in range(m):
	p,y=map(int,input().split())
	pys[i]=(p,y,i)
pys.sort(key=lambda x:x[1])

num=[0]*n
ans=[0]*m
for p,y,i in pys:
	num[p-1]+=1
	ans[i]=str(p).zfill(6)+str(num[p-1]).zfill(6)

for a in ans:
	print(a)
Buggy python submission (verdict: Runtime Error):
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
if S[0] == "A" and S[2] == "C" and islower(S[1])==True  and islower(S[3:]):
    print("AC")
else:
    print("WA")


Fixed submission:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
if S[0] == "A" and S.count("C") == 1 and S[-1] != "C":
    if S[1].islower() == True:
        if S[S.index("C")+1:].islower() == True:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())
for i in range(len(s)):
   	tmp = s[-1]
   	for j in range(len(s)-1)[::-1]:
       	s[j+1] = s[j]
   	s[0]=tmp
   	print(s)
   	if s == t:
       	break
else:
   	print("no")

Fixed submission:
s = list(input())
t = list(input())
for i in range(len(s)):
    tmp = s[-1]
    for j in range(len(s)-1)[::-1]:
        s[j+1] = s[j]
    s[0]=tmp
    if s == t:
        print("Yes")
        break
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, input().split())
value = cnt = 0
for i in range(1, n+1):
    lst = []
    lst = list(str(i))
    for num in lst:
        value += int(num)
    if a <= value <= b:
    cnt += i
    value = 0
print(cnt)

Fixed submission:
n,a,b = map(int, input().split())
value = cnt = 0
for i in range(1, n+1):
    lst = []
    lst = list(str(i))
    for num in lst:
        value += int(num)
    if a <= value <= b:
    	cnt += i
    value = 0
print(cnt)

Buggy python submission (verdict: Runtime Error):
n,a,b = map(int, f.readline().split())
value = cnt = 0
for i in range(1, n+1):
    lst = []
    lst = list(str(i))
    for num in lst:
        value += int(num)
    if a <= value <= b:
    cnt += i
    value = 0
print(cnt)

Fixed submission:
n,a,b = map(int, input().split())
value = cnt = 0
for i in range(1, n+1):
    lst = []
    lst = list(str(i))
    for num in lst:
        value += int(num)
    if a <= value <= b:
    	cnt += i
    value = 0
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = sorted(list(input()))
t = sorted(list(input()), reverse = 1)
for i in range(len(s)):
    if s[i] < t[i]:
        print("Yes")
        break
else:
    if len(s) < len(t):
        print("Yes")
    else:
        print("No")

Fixed submission:
s = sorted(list(input()))
t = sorted(list(input()), reverse = 1)
if s < t:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
"""#################################################################
【ABC081】
C - Not so Diverse
#################################################################"""

#インポート
import sys
from collections import Counter

#入力用
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))  #リスト(int型)
def MI(): return map(int, sys.stdin.readline().rstrip().split())        #多変数(int型)
def II(): return int(sys.stdin.readline().rstrip())                     # 1変数(int型)
def S(): return sys.stdin.readline().rstrip()                           #文字列(str型)

N, K = MI()
A = (LI())
A = sorted(Counter(A).values(), reverse = True)
sum = A[k:]
print(sum)

Fixed submission:
"""#################################################################
【ABC081】
C - Not so Diverse
#################################################################"""

#インポート
import sys
from collections import Counter

#入力用
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))  #リスト(int型)
def MI(): return map(int, sys.stdin.readline().rstrip().split())        #多変数(int型)
def II(): return int(sys.stdin.readline().rstrip())                     # 1変数(int型)
def S(): return sys.stdin.readline().rstrip()                           #文字列(str型)

N, K = MI()
A = LI()
A = sorted(Counter(A).values(), reverse = True)
sum = sum(A[K:])
print(sum)
Buggy python submission (verdict: Runtime Error):

#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 100
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)

Fixed submission:
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 1000000000000
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)

Buggy python submission (verdict: Runtime Error):
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 100
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)

Fixed submission:
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

N, M = ISI()
ab = [list(ISI()) for _ in range(N)]
cd = [list(ISI()) for _ in range(M)]
for i in range(N):
    min = 1000000000000
    for j in range(M):
        n = abs(ab[i][0] - cd[j][0]) +  abs(ab[i][1] - cd[j][1])
        if min > n:
            min = n
            point = j+1
    print(point)
Buggy python submission (verdict: Time Limit Exceeded):
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

INF = 10**9+7
N = II()
pow = 1
for i in range(1, N+1):
    pow *= i
print(pow%INF)

Fixed submission:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

INF = 10**9+7
N = II()
pow = 1
for i in range(1, N+1):
    pow = pow*i%INF
print(pow)
Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
cnt = 0
for i in range(a+1):
    if i > b: break
    for j in range(a+1):
        if i + j > b: break
        for k in range(a+1):
            if i + j + k > b: break
            if i + j + k == b:
                cnt += 1
print(cnt)

Fixed submission:
K, S = map(int, input().split())
cnt = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
a, b = map(int, input().split())
cnt = 0
for i in range(a+1):
    for j in range(a+1):
        for k in range(a+1):
            if i + j + k == b:
                cnt += 1
print(cnt)

Fixed submission:
K, S = map(int, input().split())
cnt = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if 0 <= z <= K:
            cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
s = (a+b)*h/2
print(int(s))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print((a+b)*int(h/2))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
S = (a+b)* h / 2
print(S)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
S = (a+b)/2 * h
S = int(S)
print(S)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
S = (a+b)/2 * h
S = int(S)
print(S)

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print(int((a+b)/2 * h))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))

Buggy python submission (verdict: Runtime Error):
a, b, h = map(int, input().split())
print(int((a+b)/2 * h))

Fixed submission:
a = int(input())
b = int(input())
h = int(input())
print(int((a+b)*h/2))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans *= i
print("-1") if ans > 10**18 else print(ans)

Fixed submission:
import sys

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in a:
    if i == 0:
        print(0)
        sys.exit()
    ans *= i
    if ans > 10**18:
        print("-1")
        sys.exit()
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans * i
if ans > 10**18:
    print("-1")
else:
    print(ans)

Fixed submission:
import sys

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in a:
    if i == 0:
        print(0)
        sys.exit()
    ans *= i
    if ans > 10**18:
        print("-1")
        sys.exit()
print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in a:
    ans = ans * i
if ans > 10**18:
    print("-1")
else:
    print(an

Fixed submission:
import sys

n = int(input())
a = list(map(int, input().split()))
a = sorted(a)
ans = 1
for i in a:
    if i == 0:
        print(0)
        sys.exit()
    ans *= i
    if ans > 10**18:
        print("-1")
        sys.exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
import array
n = int(input())
a = [int(input()) for _ in range(n)]
[print((max(array.array('H', (a[:_] + a[_ + 1:]))))) for _ in range(n)]


Fixed submission:
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(copy.copy(a), reverse=True)

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

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for _ in range(n)]
[print((max(a[:_] + a[_ + 1:]))) for _ in range(n)]


Fixed submission:
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(copy.copy(a), reverse=True)

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

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

for i in range(n):
    print(max(a[:i] + a[i + 1:]))


Fixed submission:
import copy
n = int(input())
a = [int(input()) for _ in range(n)]
b = sorted(copy.copy(a), reverse=True)

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