Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n = input()
l = list(map(int, input().split()))
l.sort(reverse=True)
s = 0
for i in range(len(l)-2):
  longest = l[i]
  if l[i+1] + l[i+2] > longest:
    for j in range(i + 1, len(l)-1):
      second = l[j]
      for k in range(len(l)-1, j, -1):
        if second + l[k] > longest:
          s += k - j
          break
print(s)

Fixed submission:
from bisect import bisect_right
n = input()
l = list(map(int, input().split()))
l.sort()
s = 0
for i in range(len(l)-2):
  for j in range(i+1, len(l)-1):
    ind = bisect_right(l, l[i] + l[j] - 1)
    s += max(ind - j - 1, 0)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
l = list(map(int, input().split()))
l.sort(reverse=True)
s = 0
for i in range(len(l)-2):
  longest = l[i]
  if l[i+1] + l[i+2] > longest:
    for j in range(i + 1, len(l)-1):
      second = l[j]
      ss = 0
      for k in range(j+1, len(l)):
        third = l[k]
        if second + third > longest:
          s += 1
          ss += 1
        else:
          break
      if ss == 0:
        break
print(s)

Fixed submission:
from bisect import bisect_right
n = input()
l = list(map(int, input().split()))
l.sort()
s = 0
for i in range(len(l)-2):
  for j in range(i+1, len(l)-1):
    ind = bisect_right(l, l[i] + l[j] - 1)
    s += max(ind - j - 1, 0)
print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = input()
l = list(map(int, input().split()))
l.sort(reverse=True)
s = 0
for i in range(len(l)-2):
  longest = l[i]
  if l[i+1] + l[i+2] > longest:
    for j in range(i + 1, len(l)-1):
      second = l[j]
      for k in range(j+1, len(l)):
        third = l[k]
        if second + third > longest:
          s += 1
        else:
          break
print(s)

Fixed submission:
from bisect import bisect_right
n = input()
l = list(map(int, input().split()))
l.sort()
s = 0
for i in range(len(l)-2):
  for j in range(i+1, len(l)-1):
    ind = bisect_right(l, l[i] + l[j] - 1)
    s += max(ind - j - 1, 0)
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
aList = list(map(int, input().split()))
ansList = []
for a in range(1, n + 1):
    ansList.append(aList.index(a) + 1)
print(' '.join(map(str, ansList)))

Fixed submission:
n = int(input())
aList = list(map(int, input().split()))
l = []
for i, a in enumerate(aList):
    l.append((a, i))
l = sorted(l, key=lambda x:x[0])
ansList = [a[1] + 1 for a in l]
print(' '.join(map(str, ansList)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = []
count = 0
for i in range(n):
    s.append(input())
for i in range(n):
    for j in range(i+1, n):
        if sorted(s[i]) == sorted(s[j]):
            count += 1
print(count)

Fixed submission:
n = int(input())
s = []
for i in range(n):
    s.append(''.join(sorted(input())))
s.sort()
count = 1
counts = []
now = s[0]
for i in range(1, n):
    if s[i] == now:
        count += 1
    else:
        if count > 1:
            counts.append(count)
        count = 1
        now = s[i]
if count > 1:
    counts.append(count)
c = 0
for i in counts:
    c += i * (i-1) // 2
print(c)
Buggy python submission (verdict: Runtime Error):
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    lm = l % 2019
    rm = r % 2019
    if lm >= rm:
        print(0)
    else:
        m = 2019
        for i in range(lm, rm):
            for j in range(i+1, rm+1):
                m = min(i * j % 2019, m)
print(m)

Fixed submission:
l, r = map(int, input().split())
if r - l >= 2019:
    print(0)
else:
    lm = l % 2019
    rm = r % 2019
    if lm >= rm:
        print(0)
    else:
        m = 2019
        for i in range(lm, rm):
            for j in range(i+1, rm+1):
                m = min(i * j % 2019, m)
        print(m)
Buggy python submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())

def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

for i in range(1, k+1):
    c = 1
    c *= comb(n-k+1, i)
    c *= comb(k-1, i-1)
    print(c%(10**9+7))

Fixed submission:
import math
n, k = map(int, input().split())
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
for i in range(1, k+1):
    if i <= n - k + 1:
        c = 1
        c *= comb(n-k+1, i)
        c *= comb(k-1, i-1)
        print(c%(10**9+7))
    else:
        print(0)

Buggy python submission (verdict: Runtime Error):
import math
n, k = map(int, input().split())

for i in range(1, k+1):
    c = 1
    for j in range(i):
        c *= n - k + 1 - j
    for l in range(i-1):
        c *= k - 1 - l
    c /= math.factorial(i)
    c /= math.factorial(i - 1)
    print(int(c)%(10**9+7))

Fixed submission:
import math
n, k = map(int, input().split())
 
def comb(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 
for i in range(1, k+1):
    if i <= n - k + 1:
        c = 1
        c *= comb(n-k+1, i)
        c *= comb(k-1, i-1)
        print(c%(10**9+7))
    else:
        print(0)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
h = list(map(int, input().split()))

c = [0 for i in range(n)]

for i in range(1, n):
    l = max(0, i-k)
    c[i] = min([c[x] + abs(h[x] - h[i]) for x in range(l, i)])

print(c[n-1])


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

c = [0 for i in range(n)]

for i in range(1, n):
    l = max(0, i-k)
    c[i] = min(cj + abs(hj - h[i]) for hj, cj in zip(h[l:i], c[l:i]))

print(c[n-1])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
x = list(map(int, input().split()))
y = sorted(x)
for i in range(n):
  if y.index(x[i]) < n//2:
    print(y[n//2])
  else:
    print(y[n//2-1])

Fixed submission:
n = int(input())
x = list(map(int, input().split()))
y = sorted(x)
a = y[n//2-1]
b = y[n//2]
for i in range(n):
  print(a if x[i] > a else b)
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
import math
import random
import sympy
from decimal import Decimal
import itertools
import re
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(2147483647)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def main():
	n = I()
	factos = factorization(n)
	count = 0
	for num, facto in factos:
		sum_tmp = 0
		for i in range(1,facto+1):
			sum_tmp += i
			if sum_tmp <= facto:
				count += 1
	print(count)


if __name__ == '__main__':
    main()

Fixed submission:
import sys
import numpy as np
import math
import random
from decimal import Decimal
import itertools
import re
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(2147483647)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


def main():
	n = I()
	factos = factorization(n)
	count = 0
	for num, facto in factos:
		sum_tmp = 0
		for i in range(1,facto+1):
			sum_tmp += i
			if sum_tmp <= facto:
				count += 1
	if n == 1:
		print(0)
	else:
		print(count)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
#import math
#import itertools
#import re
#from functools import lru_cache
 
input = sys.stdin.readline
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
 
 
def main():
    n, m = list(map(int, input().split()))
    AB = [list(map(int, input().split())) for _ in range(m)]
    graph = [[] for _ in range(n)]
    for a, b in AB:
        graph[a-1].append(b)
        graph[b-1].append(a)
    dist = np.ones(n)
    dist *= -1
    dist[0] = 0
    queue = [[1]]
    while True:
        positions = queue.pop()
        for p in positions:
            queue_next = []
            for next in graph[p-1]:
                if dist[next-1] == -1:
                    dist[next-1] = p
                    queue_next.append(next)
        if len(queue_next) == 0:
            break
        queue.append(queue_next)
    if np.count_nonzero(dist == -1) > 0:
        print(c)
    else:
        print('Yes')
        for d in dist[1:]:
            print(int(d))
 
 
if __name__ == '__main__':
    main()

Fixed submission:
import sys
import numpy as np
#import math
#import itertools
#import re
#from functools import lru_cache
from collections import deque

input = sys.stdin.readline
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline


def main():
    n, m = list(map(int, input().split()))
    AB = [list(map(int, input().split())) for _ in range(m)]
    graph = [[] for _ in range(n)]
    for a, b in AB:
        graph[a-1].append(b)
        graph[b-1].append(a)
    dist = np.ones(n)
    dist *= -1
    dist[0] = 0
    queue = deque([1])
    while queue:
        p = queue.popleft()
        for next in graph[p-1]:
            if dist[next-1] == -1:
                dist[next-1] = p
                queue.append(next)

    if np.count_nonzero(dist == -1) > 0:
        print('No')
    else:
        print('Yes')
        for d in dist[1:]:
            print(int(d))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

def main():
    x = int(input())
    a = -119
    while True:
        for b in range(-120,120):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                break
        a += 1


if __name__ == '__main__':
    main()


Fixed submission:


def main():
    x = int(input())
    for a in range(-120, 120):
        for b in range(-120, 120):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                break
        else:
            continue
        break


if __name__ == '__main__':
    main()

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


def main():
    x = int(input())
    a = 1
    while True:
        b = - pow(x - a ** 5, 1/5)
        if b == int(b):
            print(a, int(b))
            break
        a += 1

if __name__ == '__main__':
    main()


Fixed submission:


def main():
    x = int(input())
    for a in range(-120, 120):
        for b in range(-120, 120):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                break
        else:
            continue
        break


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
from sys import stdin
import numpy as np


def main():
    x = int(input())
    a = 1
    while True:
        b = - pow(x - a ** 5, 1/5)
        if b == int(b):
            print(a, int(b))
            break

if __name__ == '__main__':
    main()


Fixed submission:


def main():
    x = int(input())
    for a in range(-120, 120):
        for b in range(-120, 120):
            if a ** 5 - b ** 5 == x:
                print(a, b)
                break
        else:
            continue
        break


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#ABC128D-equeue.py

from sys import stdin

input = stdin.readline

N, K = list(map(int, input().split()))
VList = list(map(int, input().split()))
sumList = []

for i in range(K+1):
    for j in range(K-i+1):
        k = K -i -j
        myHand = [VList[n] for n in range(i)] + [VList[-m] for m in range(1,j+1)] + [0]
        myHand.sort(reverse=True)
        for _ in range(k):
            if myHand[-1] < 0:
                myHand.pop()
            else:
                break
        sumList.append(sum(myHand))


print(max(sumList))


Fixed submission:
#ABC128D-equeue.py

from sys import stdin

input = stdin.readline

N, K = list(map(int, input().split()))
VList = list(map(int, input().split()))
sumList = []

for i in range(min([K,N])+1):
    for j in range(min([K,N])-i+1):
        k = K -i -j
        myHand = [VList[n] for n in range(i)] + [VList[-m] for m in range(1,j+1)] + [0]
        myHand.sort(reverse=True)
        for _ in range(k):
            if myHand[-1] < 0:
                myHand.pop()
            else:
                break
        sumList.append(sum(myHand))


print(max(sumList))
Buggy python submission (verdict: Runtime Error):
#ABC127C-Prison.py

from sys import stdin

input = stdin.readline

N, M = list(map(int, input().split()))

L = []
R = []

for i in range(M):
    l, r = input().split()
    L.append(int(l))
    R.append(int(r))

maxL = max(L)
minR = min(R)


if maxL <= N and maxL <= minR:
    if N >= minR:
        print(minR-maxL+1)
    else:
        print(N-maxL+1)
else:
    print(0)


Fixed submission:
#ABC127A-FerrisWheel.py

from sys import stdin

A, B = list(map(int, stdin.readline().split()))

if A >= 13:
    print(B)
elif A >= 6:
    print(B//2)
else:
    print(0)
Buggy python submission (verdict: Time Limit Exceeded):
#ABC127D-IntegerCards.py

from sys import stdin

input = stdin.readline

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

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

for b, c in reversed(BC):
    for i in range(b):
        if A[i] < c:
            A[i] = c
        else:
            break
    else:
        A.sort()
        continue
    break

print(sum(A))


Fixed submission:
#ABC127D-IntegerCards.py

from sys import stdin

input = stdin.readline

N, M = list(map(int, input().split()))
A = [[1,a] for a in list(map(int, input().split()))]
BC = [list(map(int, input().split())) for _ in range(M)]

List = A + BC

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

for b, c in reversed(List):
    for i in range(b):
        if len(sumList) < N:
            sumList.append(c)
        else:
            break
    else:
        continue
    break

print(sum(sumList))
Buggy python submission (verdict: Runtime Error):
#ABC118D-MatchMatching.py

from sys import stdin
from functools import lru_cache

input = stdin.readline

N, M = list(map(int, input().split()))

A = list(map(int, input().split()))
A.sort(reverse=True)

B = [2,5,5,4,5,6,3,7,6]

def num(n):
    return B[n-1]

@lru_cache(maxsize=None)
def dp(i):
    if i == 0:
        return 0
    elif i < 0:
        return -float('inf')
    else:
        C = []
        for j in range(M):
            C.append(dp(i-num(A[j]))+1)
        return max(C)

s = ''
n = dp(N)
K = N

for i in range(n):
    for j in range(M):
        if dp(K-num(A[j])) == dp(K)-1:
            s += str(A[j])
            K -= B[A[j]-1]
            break

print(int(s))


Fixed submission:
#ABC118D-MatchMatching.py

import sys
from functools import lru_cache

sys.setrecursionlimit(10000)

input = sys.stdin.readline

N, M = list(map(int, input().split()))

A = list(map(int, input().split()))
A.sort(reverse=True)

B = [2,5,5,4,5,6,3,7,6]

def num(n):
    return B[n-1]

@lru_cache(maxsize=None)
def dp(i):
    if i == 0:
        return 0
    elif i < 0:
        return -float('inf')
    else:
        C = []
        for j in range(M):
            C.append(dp(i-num(A[j]))+1)
        return max(C)

s = ''
n = dp(N)
K = N

for i in range(n):
    for j in range(M):
        if dp(K-num(A[j])) == dp(K)-1:
            s += str(A[j])
            K -= B[A[j]-1]
            break

print(int(s))
Buggy python submission (verdict: Runtime Error):
#ABC116D-VariousSushi.py

from sys import stdin
#from numpy import sum

input = stdin.readline

N, K = list(map(int, input().split()))
List1= []
kind = set()
point1, point2 = 0, 0

INPUT = [tuple(map(int, input().split())) for _ in range(N)]

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

for ti, di in INPUT[:K]:
    point1 += di
    if ti in kind:
        List1.append(di)
    kind.add(ti)

point2 = len(kind)

Score = point1 + point2**2
Test = Score

List1POP = List1.pop

for ti, di in INPUT[K:]:
    if 0 >= len(List1):
        break
    if ti in kind:
        continue
    Test = Test - List1POP() + di + 2 * point2 + 1
    point2 += 1
    kind.add(ti)
    Score = max(Score, Test)

print(Score)


Fixed submission:
#ABC116A-RightTriangle.py

INPUT = input().split()

print(int(int(INPUT[0])*int(INPUT[1]) / 2))

Buggy python submission (verdict: Runtime Error):
#ABC116D-VariousSushi.py

from sys import stdin
from numpy import sum

input = stdin.readline

N, K = [int(n) for n in input().split()]
INPUT = [[None for i in range(2)] for j in range(N)]
List1, List2 = [], []
kind1 = []

for i in range(N):
    INPUT[i][0], INPUT[i][1] = [int(m) for m in input().split()]

INPUT = sorted(INPUT, key = lambda x: (x[1], x[0]), reverse=True)

for i in range(N):
    if INPUT[i][0] not in kind1:
            List1.append([INPUT[i][1], 1])
            kind1.append(INPUT[i][0])
    else: List1.append([INPUT[i][1], 0])

List2 = List1[K:]
if List2 != []:
    List2.sort(key =lambda x : (x[1],x[0]))
    del List1[K:]
    lenList2 = len(List2)
else: lenList2 = 0

List1 = sorted(List1, key = lambda x : (x[1], x[0]), reverse=True)

sum = sum(List1, axis = 0)

Score = sum[0] + sum[1]**2
Test = Score
kindnumber = sum[1]

for i in range(lenList2):
    if List2[-1][1] == 0 or List1[-1][1] == 1:
        break
    Test = Test - List1.pop()[0] + List2.pop()[0] + 2 * kindnumber + 1
    kindnumber = kindnumber + 1
    if Test >= Score:
        Score = Test

print(int(Score))


Fixed submission:
#ABC116A-RightTriangle.py

INPUT = input().split()

print(int(int(INPUT[0])*int(INPUT[1]) / 2))
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	s_list = list(S())
	for t in range(2,len(s_list)+1):
		for i in range(len(s_list)-t+1):
			c = Counter(s_list[i:i+t])
			if c.most_common()[0][1] / t  > 0.5:
				print(i+1, i+t)
				break
		else:
			continue
		break
	else:
		print(-1, -1)

if __name__ == '__main__':
    main()

Fixed submission:
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	s_list = list(S())
	for t in range(2,min(len(s_list)+1,4)):
		for i in range(len(s_list)-t+1):
			c = Counter(s_list[i:i+t])
			if c.most_common()[0][1] / t  > 0.5:
				print(i+1, i+t)
				break
		else:
			continue
		break
	else:
		print(-1, -1)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
x, n = map(int, input().split())

if n == 0:
    print(x)
    exit()

p = list(map(int, input().split()))
p = sorted(p)
q = [i for i in range(1, 100+1)]
r = []


for i in q:
    if i not in p:
        r.append(i)

s = [abs(x-i) for i in r]

print(r[s.index(min(s))])

Fixed submission:
x, n = map(int, input().split())
 
p = list(map(int, input().split()))
p = sorted(p)
 
if n == 0:
    print(x)
    exit()
 
q = [i for i in range(0, 101+1)]
r = []
 
for i in q:
    if i not in p:
        r.append(i)

s = [abs(x-i) for i in r]
 
print(r[s.index(min(s))])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
ans = 1
for i in range(len(a)):
    ans = ans * a[i]
if ans > 10**18:
    print(-1)
else:
    print(ans)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
ans = 1
if 0 not in a:
    for i in range(len(a)):
        ans = ans * a[i]
        if ans > 10**18:
            print(-1)
            exit()
    print(ans)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
import math
a, b = map(float, input().split()
print(math.floor(a*(b*100)/100))

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

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

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