Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K:            
            localcount += 1   
        start = j
            
    if localcount == N-1:
        ans += 1

print(ans)  

Fixed submission:
import itertools
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K:            
            localcount += 1   
        start = j
            
    if localcount == N-1:
        ans += 1

print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K == False:
            break            
        else:
            localcount += 1
            start = j
            
    if localcount == N-1:
        ans += 1

print(ans)

Fixed submission:
import itertools
N,M = (int(i) for i in input().split())
K = []
for i in range(M):
    J = [int(i) for i in input().split()]
    J.sort()
    K.append(J)

#1以外の頂点リストを作成
vertex = []
for i in range(N-1):
    vertex.append(i+2)
#順列作成
X = list(itertools.permutations(vertex))

#各値ごとに有無をチェック
ans = 0
for i in X:
    start = 1
    localcount = 0
    for j in i:
        tmp = [start,j]
        tmp.sort()
        if tmp in K:            
            localcount += 1   
        start = j
            
    if localcount == N-1:
        ans += 1

print(ans)
Buggy python submission (verdict: Runtime Error):
a = map(int,input())
print(a + a**2 + a**3)

Fixed submission:
a = int(input())
print(a + a**2 + a**3)
Buggy python submission (verdict: Runtime Error):
S = input()
T = input()
ans = 0
for i, ch in enumerate(S):
  if ch != T[i]:
    ans += 1
return ans

Fixed submission:
S = input()
T = input()
ans = 0
for i, ch in enumerate(S):
  if ch != T[i]:
    ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
"https://codeforces.com/contest/1328/problem/A"
import collections, heapq, itertools, math, functools
groupby = itertools.groupby
rs  = lambda: input()
ri  = lambda: int(input())
rm  = lambda: map(int, input().split())
rai = lambda: [int(x) for x in input().split()]

from functools import reduce

def solve():
    N = ri()
    ans = 0
    for i in range(1, N+1):
        for j in range(1, N+1):
            if i%j == 0:
                ans += i
    return ans
print(solve())

Fixed submission:
import collections, heapq, itertools, math, functools
groupby = itertools.groupby
rs  = lambda: input()
ri  = lambda: int(input())
rm  = lambda: map(int, input().split())
rai = lambda: [int(x) for x in input().split()]

def solve():
    N = ri()
    ans = 0
    for i in range(1, N + 1):
        n = N // i
        ans += i * n * (n + 1) // 2
    return ans
print(solve())

Buggy python submission (verdict: Time Limit Exceeded):
"https://codeforces.com/contest/1328/problem/A"
import collections, heapq, itertools, math, functools
groupby = itertools.groupby
rs  = lambda: input()
ri  = lambda: int(input())
rm  = lambda: map(int, input().split())
rai = lambda: [int(x) for x in input().split()]

from functools import reduce

def solve():
    N = ri()
    ans = 0
    for i in range(1, N+1):
        for j in range(1, N+1):
            if i%j == 0:
                ans += i
    return ans
print(solve())

Fixed submission:
import collections, heapq, itertools, math, functools
groupby = itertools.groupby
rs  = lambda: input()
ri  = lambda: int(input())
rm  = lambda: map(int, input().split())
rai = lambda: [int(x) for x in input().split()]

def solve():
    N = ri()
    ans = 0
    for i in range(1, N + 1):
        n = N // i
        ans += i * n * (n + 1) // 2
    return ans
print(solve())
Buggy python submission (verdict: Runtime Error):
s=input()
return s[2]==s[3] and s[4]==s[5]

Fixed submission:
S = input()
print("Yes" if S[2]==S[3]and S[4]==S[5] else "No")
Buggy python submission (verdict: Runtime Error):
X,Y,A,B,C = [int(x) for x in input().split()]
R = [int(x) for x in input().split()]
G = [int(x) for x in input().split()]
CL = [int(x) for x in input().split()]

dp = [[0]*(X+1) for d in range(Y+1)]
for i in range(X):
    for j in range(Y):
        MAX = max(max(R[j],CL[j]),max(G[i],CL[i]))
        dp[i][j] = MAX
        if MAX == R[j]:
            A.pop(0)
        elif MAX == G[i]:
            B.pop(0)
        else:
            C.pop(0)

print(dp[-1])

Fixed submission:
X,Y,A,B,C = [int(x) for x in input().split()]
R = sorted([int(x) for x in input().split()],reverse = True)[:X]
G = sorted([int(x) for x in input().split()],reverse = True)[:Y]
CL = sorted([int(x) for x in input().split()],reverse = True)[:X+Y]
total = sorted(R+G+CL, reverse=True)[:X+Y]
print(sum(total))
Buggy python submission (verdict: Runtime Error):
import bisect
from collections import defaultdict as dd

def factorize(n):
    b = 2
    fct = []

    while b * b <= n:
        while n % b == 0:
            n //= b
            fct.append(b)
        b += 1
    
    if n > 1:
        fct.append(n)
    
    return fct

N = int(input())
f = factorize(N)
dic = dd(int)

for val in f:
    if val != 1:
        dic[val] += 1
res = 0

ls = [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66]

for val in dic.values():
    tmp = bisect.bisect_right(ls, val)
    res += tmp

print(res)

Fixed submission:
a,b = map(int, input().split())
print(a*b)
Buggy python submission (verdict: Runtime Error):
ans=0
x,y=input().split()
for i in range(len(x)):
  if x[i] != y[i]:
    ans=ans+1
print(ans)

Fixed submission:
ans=0
x=input()
y=input()
for i in range(len(x)):
  if x[i] != y[i]:
    ans=ans+1
print(ans)
Buggy python submission (verdict: Runtime Error):
X = list(map(int,input().split()))

if X[0]==0:
  print(1)
 elif X[1] == 0:
    print(2)
 elif X[2] == 0:
    print(3)
 elif X[3] == 0:
    print(4)
 else:
    print(5)


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

if X[0]==0:
  print(1)
elif X[1] == 0:
  print(2)
elif X[2] == 0:
  print(3)
elif X[3] == 0:
  print(4)
else:
  print(5)

Buggy python submission (verdict: Runtime Error):
X = list(map(int,input().split()))

if X[0]==0:
  print(1)
  elif X[1] == 0:
    print(2)
    elif X[2] == 0:
      print(3)
      elif X[3] == 0:
        print(4)
        else:
          print(5)

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

if X[0]==0:
  print(1)
elif X[1] == 0:
  print(2)
elif X[2] == 0:
  print(3)
elif X[3] == 0:
  print(4)
else:
  print(5)
Buggy python submission (verdict: Runtime Error):
1 X = list(map(int, input().split()))

print(X[0]*X[1])

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

print(X[0]*X[1])
Buggy python submission (verdict: Runtime Error):
NUM = list(map(int,input().split))

if(NUM[0] >= NUM[1]):
  print("unsafe")
elif(NUM[0] < NUM[1]):
  print("safe")

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

if(NUM[0] > NUM[1]):
  print("safe")
elif(NUM[0] <= NUM[1]):
  print("unsafe")
Buggy python submission (verdict: Runtime Error):
MON = list(map(int,input().split()))

While True:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break

  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break
  

Fixed submission:
MON = list(map(int,input().split()))
 
while 1:
  
  MON[2] = MON[2] - MON[1]
  if(MON[2] <= 0):
    print("Yes")
    break
 
  MON[0] = MON[0] - MON[3]
  if (MON[0] <= 0 ):
    print("No")
    break
Buggy python submission (verdict: Runtime Error):
N = int(input())
sum = 0
for i in range(N+1):
  if(i % 3 != 0 and i % 5 != 0):
    sum += i
  
  if(i > )

Fixed submission:
N = int(input())
sum = 0
for i in range(N+1):
  if(i % 3 != 0 and i % 5 != 0):
    sum += i

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

if n / m == 1:
    print("Yes")
else:
    print("No")


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

if n == m:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())

s = []
for i in range(2, n + 1):
    j = n - i
    if j >= 2 and i + j == n:
        a = sum(map(int, str(i)))
        b = sum(map(int, str(j)))
        s.append(a + b)
print(min(s))


Fixed submission:
n = int(input())

s = []
for i in range(1, n):
    j = n - i
    if i + j == n:
        a = sum(map(int, str(i)))
        b = sum(map(int, str(j)))
        s.append(a + b)
print(min(s))
Buggy python submission (verdict: Runtime Error):
a = []
cnt = s.count("E")
s.insert(0, 0)
s.append(0)
for i in range(1, n + 1):
    if s[i - 1] == "W":
        cnt += 1
    if s[i] == "E" and cnt != 0:
        cnt -= 1
    a.append(cnt)
print(min(a))


Fixed submission:
n = int(input())
s = list(map(str, input()))
a = []
cnt = s.count("E")
s.insert(0, 0)
s.append(0)
for i in range(1, n + 1):
    if s[i - 1] == "W":
        cnt += 1
    if s[i] == "E" and cnt != 0:
        cnt -= 1
    a.append(cnt)
print(min(a))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = list(map(str, input()))

a = []
for i in range(n):
    cnt = 0
    if "E" in s[i + 1 :]:
        cnt += s[i + 1 :].count("E")
    if "W" in s[:i]:
        cnt += s[:i].count("W")
    a.append(cnt)
print(min(a))


Fixed submission:
n = int(input())
s = list(map(str, input()))
a = []
cnt = s.count("E")
s.insert(0, 0)
s.append(0)
for i in range(1, n + 1):
    if s[i - 1] == "W":
        cnt += 1
    if s[i] == "E" and cnt != 0:
        cnt -= 1
    a.append(cnt)
print(min(a))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = 1
for i in range(1, n + 1):
    s = s * i
print(s % (10 ** 9 + 7))


Fixed submission:
n = int(input())
s = 1
m = 10 ** 9 + 7
for i in range(1, n + 1):
    s = (s * i) % m
print(s)
Buggy python submission (verdict: Runtime Error):
a = int(imput())
m = int(a / 3)
print(m)

Fixed submission:
a = int(raw_input())
m = int(a / 3)
print(m)
Buggy python submission (verdict: Runtime Error):
n = raw_input()
a = [i for i in raw_input().split()]
l = len(list(set(a)))
if l == 3:
  print("Three")
else if l== 4:
  print("Four")
  
  

Fixed submission:
n = raw_input()
a = [i for i in raw_input().split()]
l = len(list(set(a)))
if l == 3:
  print("Three")
if l == 4:
  print("Four")
Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))

X= num[0]
Y =num[1]
ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    braek;
print(ans)

Fixed submission:
num = list(map(int, input().split()))
X= num[0]
Y =num[1]

ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    break;
print(ans)

Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))

X= num[0]
Y =num[1]

for i in range(X+1):
  if 4*X - 2*i == Y:
    print("Yes")
    braek;
  else:
    print("No")
    break;

Fixed submission:
num = list(map(int, input().split()))
X= num[0]
Y =num[1]

ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    break;
print(ans)

Buggy python submission (verdict: Runtime Error):
num = list(map(int, input().split()))

X= num[0]
Y =num[1]

for i in range(X):
  if 4*X - 2*i == Y:
    print("Yes")
    braek;
  else:
    print("No")
    break;

Fixed submission:
num = list(map(int, input().split()))
X= num[0]
Y =num[1]

ans = "No"
for i in range(X+1):
  if 4*X - 2*i == Y:
    ans = "Yes"
    break;
print(ans)
Buggy python submission (verdict: Runtime Error):
A = input().split()
A_pos = int(A[0])
A_v = int(A[1])
B = input().split()
B_pos = int(B[0])
B_v = int(B[1])

T = int(input())

if(A_pos>B_pos):
  if(A_v >= B_v):
    print("NO")
  else:
    dif_v = B_v - A_v
    if(dif_v * T >= A_pos - B_pos):
      print("YES")
    else:
      print("NO")
else:
  if(B_v >= A_v):
    print("NO")
  else:
    dif_v = A_v - B_v
    if(dif_v * T >= B_pos - A_pos):
      print("YES")
    else:
      print("NO")

Fixed submission:
s = input()
print(s[0:3])
Buggy python submission (verdict: Runtime Error):
N = int(input()) #1行目のNを取得する
i = list(map(int, input().split()))

result = 1
flag = 0
for x in range(N):
  result *= i[x]
  if(result>pow(10,18)):
    result = -1
    flag = 1
    break

if(flag==0):
  print(result)
else:
  print('-1')






Fixed submission:
i = list(map(int, input().split()))
print(i[0]*i[1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input()) #1行目のNを取得する
i = list(map(int, input().split()))

result = 1

for x in range(N):
  result *= i[x]

  
if(result>pow(10,18)):
   result = -1
print(result)



Fixed submission:
N = int(input()) 
i = list(map(int, input().split()))

result = 1
flag = 0
zero_flag = False
for x in range(N):
  if(i[x]==0):
    zero_flag = True
    result = 0

if(zero_flag==False):
  for x in range(N):
    result *= i[x]
    if(result>pow(10,18)):
      flag = 1
      break

if(flag==1):
  print('-1')
else:
  print(result)
Buggy python submission (verdict: Runtime Error):
limit = int(input())
original = input()
if(int(len(original))>limit):
  print(original[0:limit]+ "..." )
else:
  print(original)

Fixed submission:
num = input()
one_num = len(num) - 1
if (num[one_num] == "3"):
  print("bon")
elif (num[one_num] == "0" or num[one_num] == "1" or num[one_num] == "6" or num[one_num] == "8"):
  print("pon")
else:
  print("hon")
Buggy python submission (verdict: Runtime Error):
X = list(map(int,input().split()))
A = X[0]
B = X[1]
C = X[2]
K = X[3]
score=[1,0,-1]
max_score = 0
nums = []

if (K>=A):
  max_score += 1*A
if (K-A>=B):
  max_score += 2*B
if (K-A-B>0):
  max_score += (-1)*(K-A-B)
print(max_score)
  

Fixed submission:
a = [input() for i in range(2)]
flag = 0
for i in range(len(a[0])):
  if(a[0][i]==a[1][i]):
    flag = flag+1
if(flag==len(a[0])):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
if(S[1]=="B"):
    result = S.replace("B","R")
else:
    result = S.replace("R","B")
print(result)

Fixed submission:
S = input()
if(S[1]=="B"):
    result = S.replace("B","R")
else:
    result = S.replace("R","B")
print(result)
Buggy python submission (verdict: Runtime Error):
def func(x,y):
  if (x*y % 2 == 0): return("Even")
  else: return ("Odd")
a,b = input.split()
func(x,y)

Fixed submission:
def choise(a,b):
    if(a*b%2 == 0):return "Even"
    else:return "Odd"




if __name__ == "__main__":
    i1, i2 = map(int, input().split())
    print(choise(i1, i2))
Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
	A = list(map(lambda x:x/2,A))
    i++;
print(i)    
       

Fixed submission:
def choise(s):
  return len(list(filter(lambda x:x=='1',s)))

if __name__ == "__main__":
    i1 = input()
    print(choise(i1))

Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
A = list(map(lambda x:x/2,A))
    i++;
print(i)  
       

Fixed submission:
def choise(s):
  return len(list(filter(lambda x:x=='1',s)))

if __name__ == "__main__":
    i1 = input()
    print(choise(i1))
Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
	A = list(map(lambda x:x/2,A))
    i++;
print(i)    
       

Fixed submission:
def choise(n,s):
    k = 0
    lis = s.split()
    lis = list(map(lambda x: int(x), lis))
    while (len(lis) == int(n)):
        lis = list(filter(lambda x: x % 2 == 0, lis))
        if (len(lis) == int(n)): k += 1
        lis = list(map(lambda x: x / 2, lis))
    return k

if __name__ == "__main__":
    n = input()
    s = input()

    print(choise(n,s))

Buggy python submission (verdict: Runtime Error):
N = input()
A = list(map(int,input().split()))
#２の倍数かどうかを調べる関数　引数:4→True,5→False

def isAllEVEN(A):
    return (not (False in (list(map(lambda x:x%2==0,A)))))

i = 0
while(isAllEVEN(A)):
A = list(map(lambda x:x/2,A))
    i++;
       

Fixed submission:
def choise(n,s):
    k = 0
    lis = s.split()
    lis = list(map(lambda x: int(x), lis))
    while (len(lis) == int(n)):
        lis = list(filter(lambda x: x % 2 == 0, lis))
        if (len(lis) == int(n)): k += 1
        lis = list(map(lambda x: x / 2, lis))
    return k

if __name__ == "__main__":
    n = input()
    s = input()

    print(choise(n,s))
Buggy python submission (verdict: Runtime Error):
a = int(a)
x = a + a**2 + a**3
print(x)

Fixed submission:
a = int(input())
x = a + a**2 + a**3
print(x)

Buggy python submission (verdict: Runtime Error):
a = int(a)
x = int(x)
x = a + a**2 + a**3
print(x)

Fixed submission:
a = int(input())
x = a + a**2 + a**3
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int, input().split()))
max = 0
for i in range(n-1):
    tmp = 0
    j = i
    while h[j]>=h[j+1]:
        j += 1
        tmp += 1
        if j == n-1:
            break
    if tmp>max:
        max = tmp
print(max)



Fixed submission:
n = int(input())
h = list(map(int, input().split()))
max = 0
tmp = 0
for i in range(n-1):
    if h[i] >= h [i+1]:
        tmp += 1
    else:
        tmp = 0
    if tmp > max:
        max = tmp
print(max)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = 0
for i in range(n-1):
    m += (i+1)
print(m)


Fixed submission:
n = int(input())
m = (n-1)*n//2
print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
tmp = 0
max = 0
for i in range(n):
    max = max + i
print(max)


Fixed submission:
n = int(input())
m = (n-1)*n//2
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]
for i in range(n):
    tmp=0
    for j in range(n):
        if(j!=i and tmp<a[j]):
            tmp = a[j]
    print(tmp)


Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]
max = 0
max2 = 0
tmp = 0
for i in range(n):
    if max<a[i]:
        max = a[i]
        tmp=i
for i in range(n):
    if tmp!=i and max2<a[i]:
        max2 = a[i]

for i in range(n):
    if i != tmp:
        print(max)
    else:
        print(max2)
Buggy python submission (verdict: Runtime Error):
# 全部亀でもならない合計足数に足りない
if y > x * 4:
    print('No')
# 全部鶴でも合計足数をはみ出す
elif y < x * 2:
    print('No')
# 足が奇数
elif y % 2 == 1:
    print('No')
else:
    print('Yes')

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

# 全部亀でもならない合計足数に足りない
if y > x * 4:
    print('No')
# 全部鶴でも合計足数をはみ出す
elif y < x * 2:
    print('No')
# 足が奇数
elif y % 2 == 1:
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))

if 0 in li:
    print(0)
    exit()

ans = 1
for i in li:
    ans *= i

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

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

if 0 in li:
    print(0)
    exit(0)

ans = 1
for i in li:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit(0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))

ans = 1
for i in li:
    ans *= i

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

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

if 0 in li:
    print(0)
    exit(0)

ans = 1
for i in li:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit(0)

print(ans)

Buggy python submission (verdict: Runtime Error):
import numpy as np

n = input()
li = list(map(float, input().split()))
result = np.prod(li)

if float(result) >= 1000000000000000001:
    print(-1)
else:
    print(int(result))

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

if 0 in li:
    print(0)
    exit(0)

ans = 1
for i in li:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit(0)

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import functools
import operator

n = input()
li = list(map(int, input().split()))
result = functools.reduce(operator.mul, li)

if result >= 1000000000000000001:
    print(-1)
else:
    print(result)

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

if 0 in li:
    print(0)
    exit(0)

ans = 1
for i in li:
    ans *= i
    if ans > 10 ** 18:
        print(-1)
        exit(0)

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())

ls = []

for i in range(count):
    ls.append(input())

max = 0
ans = []

for s in set(ls):
    i = ls.count(s)
    if i >= max:
        if i > max:
            ans = []

        ans.append(s)
        max = i

print('\n'.join(sorted(ans)))

Fixed submission:
count = int(input())

ls = {}

for i in range(count):
    s = input()
    if s in ls:
        ls[s] += ls[s] + 1
    else:
        ls.setdefault(s, 1)

m = max(ls.values())

ans = [k for k, v in ls.items() if v == m]

print('\n'.join(sorted(ans)))

Buggy python submission (verdict: Time Limit Exceeded):
count = int(input())

ls = []

for i in range(count):
    ls.append(input())

max = 0
ans = []

for s in set(ls):
    i = ls.count(s)
    if i >= max:
        if i > max:
            ans.clear()

        ans.append(s)
        max = i

print('\n'.join(sorted(ans)))

Fixed submission:
count = int(input())

ls = {}

for i in range(count):
    s = input()
    if s in ls:
        ls[s] += ls[s] + 1
    else:
        ls.setdefault(s, 1)

m = max(ls.values())

ans = [k for k, v in ls.items() if v == m]

print('\n'.join(sorted(ans)))

Buggy python submission (verdict: Time Limit Exceeded):
import copy

count = int(input())

ls = []

for i in range(count):
    ls.append(input())

buff = copy.copy(ls)
ls2 = set(buff)

max = 0
ans = []

for s in ls2:
    if ls.count(s) >= max:
        if ls.count(s) > max:
            ans.clear()

        ans.append(s)
        max = ls.count(s)

print('\n'.join(sorted(ans)))

Fixed submission:
count = int(input())

ls = {}

for i in range(count):
    s = input()
    if s in ls:
        ls[s] += ls[s] + 1
    else:
        ls.setdefault(s, 1)

m = max(ls.values())

ans = [k for k, v in ls.items() if v == m]

print('\n'.join(sorted(ans)))
Buggy python submission (verdict: Runtime Error):
num = int(input())
ls = list(map(str, input().split(" ")))

diff = 0
for i in range(num):
    if (ls[i] != i+1):
        diff += 1

if diff == 2 or diff == 0:
    print("YES")
else:
    print("NO")

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

if (a + b) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print(int((a + b) / 2))
Buggy python submission (verdict: Runtime Error):
import math
a, b, x = list(map(float, input().split()))
if x <= 0.5 * a * a * b:
    res = math.atan(2 * x / (a * b * b))
else:
    res = math.atan(a / (2 * (b - x / a ** 2)))
print(f'{90 - res * 180 / math.pi:.7f}')


Fixed submission:
import math
a, b, x = list(map(float, input().split()))
if x <= 0.5 * a * a * b:
    res = math.degrees(math.atan(2 * x / (a * b * b)))
elif x < a * a * b:
    res = math.degrees(math.atan(a / (2 * (b - x / a ** 2))))
else:
    res = 90.0
print(f'{90 - res:.7f}')