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

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C == map(int, readline().split())
    if A == B:
        print(C)
    elif B == C:
        print(A)
    else:
        print(B)


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(int, input().split())
    if A == B:
        print(C)
    elif B == C:
        print(A)
    else:
        print(B)


if __name__ == '__main__':
    main()

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

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C == map(int, readline().split())
    if A == B:
        print(C)
    elif B == C:
        print(A)
    else:
        print(bin())


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    A, B, C = map(int, input().split())
    if A == B:
        print(C)
    elif B == C:
        print(A)
    else:
        print(B)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
import numpy as np
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    t = [0]*N
    for i in range(N):
        t[i] = int(readline())
    T = np.array(t)
    ans = np.lcm.reduce(T)
    print(ans)


if __name__ == '__main__':
    main()

Fixed submission:
import sys
readline = sys.stdin.buffer.readline
from fractions import gcd
from functools import reduce
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def lcm_base(x, y):
    return (x * y) // gcd(x, y)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

def main():
    N = int(readline())
    T = [0]*N
    for i in range(N):
        T[i] = int(readline())
    ans = lcm_list(T)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
readline = sys.stdin.buffer.readline
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_matrix
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    A = []
    B = []
    C = []
    for _ in range(N-1):
        a,b,c = map(int, readline().split())
        a -= 1
        b -= 1
        A += [a,b]
        B += [b,a]
        C += c,c

    Q,K = map(int, readline().split())
    L = dijkstra(csr_matrix((C, (A, B)), shape=(N, N)),indices=K-1)
    for _ in range(Q):
        x,y = map(int, readline().split())
        print(int(L[x-1]+L[y-1]))

if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import deque
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N = int(readline())
    G = [[] for i in range(N)]
    for i in range(N - 1):
        a, b, c = map(int, readline().split())
        G[a-1].append((b-1, c))
        G[b-1].append((a-1, c))

    dist = [-1 for i in range(N)]
    Q, K = map(int, readline().split())
    dist[K-1] = 0
    q = deque([[K - 1, 0, -1]])
    while q:
        v, d, parent = q.popleft()
        dist[v] = d
        for child in G[v]:
            if child[0] == parent:
                continue
            q.append([child[0], d + child[1], v])

    for i in range(Q):
        x, y = map(int, readline().split())
        print(dist[x - 1] + dist[y - 1])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
4 3 6

Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    X, A, B = map(int, readline().split())
    if -A+B<=0:
        print('delicious')
    elif 0<-A+B<=X:
        print('safe')
    else:
        print('dangerous')


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A, B = map(int, readline().split())
    if A>B:
        print('GREATER')
    elif A<B:
        print('LESS')
    else:
        print('EQUAL')




if __name__ == '__main__':
    main()

Fixed submission:
import sys
from collections import Counter
readline = sys.stdin.buffer.readline
MOD = 10**9+7

def main():
    A = int(readline())
    B = int(readline())
    if A>B:
        print('GREATER')
    elif A<B:
        print('LESS')
    else:
        print('EQUAL')




if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, L, T = map(int, readline().split())
    position = []
    #0をL-1からーに時計回りに超える場合は+1
    #0からL-1に反時計回りに超える場合は-1
    count = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
            count += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                count += (x-T+1)//L
            position.append((x-T)%L)
    position.sort()
    if count>=0:
        ans = position[count:] + position[:count]
    for i in range(N):
        print(ans[i])


if __name__ == '__main__':
    main()

Fixed submission:
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, L, T = map(int, readline().split())
    position = []
    #0をL-1からーに時計回りに超える場合は+1
    #0からL-1に反時計回りに超える場合は-1
    count = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
            count += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                count += (x-T)//L
            position.append((x-T)%L)
    position.sort()
    count %= N
    ans = position[count:] + position[:count]
    for i in range(N):
        print(ans[i])


if __name__ == '__main__':
    main()

Buggy python submission (verdict: Runtime Error):
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, L, T = map(int, readline().split())
    position = []
    #0をL-1からーに時計回りに超える場合は+1
    #0からL-1に反時計回りに超える場合は-1
    count = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
            count += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                count += (x-T+1)//L
            position.append((x-T)%L)
    position.sort()
    if count>=0:
        ans = position[count:] + position[:count]
    print(ans)


if __name__ == '__main__':
    main()

Fixed submission:
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, L, T = map(int, readline().split())
    position = []
    #0をL-1からーに時計回りに超える場合は+1
    #0からL-1に反時計回りに超える場合は-1
    count = 0
    for i in range(N):
        x,w = map(int, readline().split())
        if w==1:
            count += (x+T)//L
            position.append((x+T)%L)
        else:
            if x-T<0:
                count += (x-T)//L
            position.append((x-T)%L)
    position.sort()
    count %= N
    ans = position[count:] + position[:count]
    for i in range(N):
        print(ans[i])


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    K = int(readline())
    X = int(readline())
    Y = int(readline())
    if N <= K:
        ans = X * N
    else:
        ans = X * k + Y * (N - K)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    K = int(readline())
    X = int(readline())
    Y = int(readline())
    if N <= K:
        ans = X * N
    else:
        ans = X * K + Y * (N - K)
    print(ans)


if __name__ == '__main__':
    main()

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

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    K = int(readline())
    X = int(readline())
    Y = int(readline())
    if N<=K:
        ans = X*N
    else:
        ans += X*k + Y*(N-K)
    print(ans)


if __name__ == '__main__':
    main()


Fixed submission:
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N = int(readline())
    K = int(readline())
    X = int(readline())
    Y = int(readline())
    if N <= K:
        ans = X * N
    else:
        ans = X * K + Y * (N - K)
    print(ans)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
n = int(input())
c = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
      	print('Yes')
      	break
  else:
    c=0
if c1==0:
    print('No')


Fixed submission:
n = int(input())
c = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
        print('Yes')
        break
  else:
    c=0
if c1==0:
    print('No')

Buggy python submission (verdict: Runtime Error):
n = int(input())
c = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
      print('Yes')
      break
  else:
    c=0
if c1==0:
    print('No')

Fixed submission:
n = int(input())
c = 0
c1=0
for x in range(n):
  a,b = map(int,input().split())
  if a==b:
    c+=1
    if c==3:
        c1 = 1
        print('Yes')
        break
  else:
    c=0
if c1==0:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l = list(map(int,input().split()))
s = 0
for x in range(n-1):
  s+=l[x]*(sum(l[x+1:]))
print(s%1000000007)

Fixed submission:
n = int(input())
l = list(map(int,input().split()))
s = 0
s1 = sum(l)
a = 0
for x in range(n-1):
  s+=(l[x]*(s1-l[x]-a))
  a+=l[x]
print(s%1000000007)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
c = 0
for i in range(N-1):
    for j in range(i+1,N):
        c += (A[i] * A[j]) %(10**9+7)
print(c%(10**9+7))

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
sumA = sum(A)
c = 0

for i in range(N-1):
    c+= A[i]* (sumA-A[i])
    sumA-= A[i]
print(c%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
P = list(map(lambda x: int(x) - 1, input().split()))
C = list(map(int,input().split()))

ans = 10**20 * -1
for si in range(N):
    x = si
    s = []
    tot = 0
    while True:
        x = P[x]
        s.append(C[x])
        tot += C[x]
        if x == si:
            break
    l = len(s)
    t = 0
    for i in range(l):
        t += s[i]
        if i+1 > K:
            break

        now = t
        if tot > 0:
            e = (K - (i + 1)) // l
            now += tot * e
        ans = max(ans, now)
print(ans)



Fixed submission:
N, K = map(int, input().split())
P = list(map(lambda x: int(x) - 1, input().split()))
C = list(map(int,input().split()))

ans = 10**20 * -1
for si in range(N):
    x = si
    s = []
    tot = 0
    while True:
        x = P[x]
        s.append(C[x])
        tot += C[x]
        if x == si:
            break
    l = len(s)
    t = 0
    for i in range(l):
        t += s[i]
        if i+1 > K:
            break

        now = t
        if tot > 0:
            e = (K - (i + 1)) // l
            now += tot * e
        ans = max(ans, now)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
c = list(input())
Wcount = c.count('R')
CursedCount = 0
i = 0
while i < N-1:
    if c[i] == 'W':
        if c[i+1] == 'R':
            t = N-1
            while i < t:
                if c[t] == 'R':
                    c[i] = 'R'
                    c[t] = 'W'

                    CursedCount += 1
                    i = -1
                    break
                t-=1
    i += 1


print(min(Wcount,CursedCount))

Fixed submission:
N = int(input())
c = list(input())

a = 0
b = 0
for i in range(N):
    if (c[i] == 'R'):
        a +=1
ans = max(a,b)
for i in range(N):
    if (c[i] == 'R'):
        a -= 1
    else:
        b += 1
    now = max(a,b)
    ans = min(ans,now)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())
A = list(map(int,input().split()))

b = 1
for j in range(K):
    b *= A[j]

for i in range(1, N-K+1):
    a = b // A[i-1]
    a *= A[i+K - 1]
    print('Yes' if a > b else 'No')
    b = a




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

for i in range(1, N-K+1):
    print('Yes' if A[i - 1] < A[i+K - 1] else 'No')

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())
A = list(map(int,input().split()))

b = 1
for j in range(K):
    b *= A[j]

for i in range(1, N-K+1):
    a = 1
    for j in range(K):
        a *= A[i+j]
    print('Yes' if a > b else 'No')
    b = a




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

for i in range(1, N-K+1):
    print('Yes' if A[i - 1] < A[i+K - 1] else 'No')
Buggy python submission (verdict: Runtime Error):
N = int(input())
cs = [0]*N
for i in range(1,130):
    for j in range(1,130):
        for k in range(1,130):
            temp = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if temp =< N and temp > 0:
                cs[temp-1] += 1
for i in range(N):
    print(cs[i])


Fixed submission:
L,R,d = map(int,input().split())
c = 0
for i in range(L,R+1):
  if i % d ==0:
    c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
N = int(input())
cs = [0]*N
for i in range(1,130):
    for j in range(1,130):
        for k in range(1,130):
            temp = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if temp =< N and temp > 0:
                cs[temp-1] += 1
for i in range(N):
    print(cs[i])


Fixed submission:
N = int(input())
cs = [0]*N
for i in range(1,130):
    for j in range(1,130):
        for k in range(1,130):
            temp = i**2 + j**2 + k**2 + i*j + j*k + k*i
            if temp <= N and temp > 0:
                cs[temp-1] += 1
for i in range(N):
    print(cs[i])
Buggy python submission (verdict: Runtime Error):
from itertools import combinations
import copy
H,W,K = map(int,input().split())
cs = [list(input()) for i in range(H)]
HC = [i for i in range(H)]
WC = [i for i in range(W)]
cBlackCount=0
c=0
for i in range(H+1):
  for j in range(W+1):
    for selectRows in combinations(HC,i):
      for selectCols in combinations(WC,j):
        cBlackCount=fBlackCount
        for m in range(H):
          for n in range(W):
            if cs[m][n] == '#':
              if m in selectRows or n in selectCols:
                cBlackCount+=1
        if cBlackCount == K:
          c+=1
print(c)
          
  


Fixed submission:
from itertools import combinations
import copy
H,W,K = map(int,input().split())
cs = [list(input()) for i in range(H)]
HC = [i for i in range(H)]
WC = [i for i in range(W)]
fBlackCount=0
for i in range(H):
  fBlackCount += cs[i].count('#')
cBlackCount=fBlackCount
c=0
for i in range(H+1):
  for j in range(W+1):
    for selectRows in combinations(HC,i):
      for selectCols in combinations(WC,j):
        #print(selectRows)
        #print(selectCols)
        cBlackCount=fBlackCount
        for m in range(H):
          for n in range(W):
            if cs[m][n] == '#':
              if m in selectRows or n in selectCols:
                cBlackCount-=1
        if cBlackCount == K:
          #print(i)
          #print(j)
          #print(selectRows)
          c+=1
print(c)
Buggy python submission (verdict: Runtime Error):
import math
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
ans = 0
for i in range(n-1):
  ans += b[n-(math.floor(i/2))]
print(ans)


Fixed submission:
import math
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
ans = 0
for i in range(n-1):
  ans += b[n-1-(math.ceil(i/2))]
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A= list(map(int,input().split()))
A.sort(reverse=True)
top = A[0]
if N == 2:
  B=[top]
else:
  B=[top]

c=0
  
for i in range(1,N):
  if i == 1:
    ma = top
    tekito=1
  else:
    ma = min(B[0],B[1])
  mai = 1
  for j in range(1,len(B)):
    if j == len(B)-1:
      tekito = 0
    else:
      tekito = j+1
    #print(tekito)
    koho = min(B[j],B[tekito])
    if ma > koho:
      ma =koho
      mai = tekito
  c+= ma
  B.insert(tekito, A[i])
      
#c=0
#d= len(B)
#for i in range(d):
#  if i == 1:
#    continue
#  if i != d-1:
#    c+= min(B[i-1],B[i+1])
#  else:
#    c+= min(B[i-1],B[0])
#print(B)
print(c)



Fixed submission:
import math
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
ans = 0
for i in range(n-1):
  ans += b[n-1-(math.ceil(i/2))]
print(ans)
Buggy python submission (verdict: Runtime Error):
D = int(input())
cs = list(map(int,input().split()))
ss =[]
for i in range(D):
  ss.append(list(map(int,input().split())))
ts = []
for i in range(D):
  ts.append(int(input()))
M = int(input())
Qs =[]
for i in range(M):
    Qs.append(list(map(int,input().split())))
for r in range(len(Qs)):
  d= Qs[r][0]
  q= Qs[r][1]
  ts[d-1] = q
  last = [0] * 26
  total =0
  for i in range(len(ts)):
    t = ts[i]
    last[t-1] = i+1
    genten=0
    for j in range(len(cs)):
      genten += cs[j] *(i+1 - last[j])
    total += ss[i][t-1]-genten
  print(total)
  
 

Fixed submission:
for i in range(365):
  t = 1
  print(t)
  if t == 26:
    t = 1
  else:
    t +=1
Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
f = open('input.txt', 'r')
sys.stdin = f
N,M,K = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))

ai =0
bi=0
st =0
c = 0
while True:
  if ai == N:
    if bi == M:
      break
    else:
      st += b[bi]
      if st > K:
        break
      bi += 1
      c +=1
  elif bi == M:
    if ai == N:
      break
    else:
      st += a[ai]
      if st > K:
        break
      ai += 1
      c += 1
  elif a[ai] > b[bi]:
    st += b[bi]
    if st > K:
      break
    bi +=1
    c +=1
  elif a[ai] < b[bi]:
    st += a[ai]
    if st > K:
      break
    ai +=1
    c +=1
  elif a[ai] == b[bi]:
    tmpst = st
    tmpc =0
    tmpai = ai
    tmpbi = bi
    while True:
      tmpst +=a[tmpai]
      if tmpai < N-1:
        tmpai+=1
      if tmpbi < M-1:
        tmpbi+=1
      if tmpst > K:
        st += a[ai]
        if st > K:
          print(c)
          exit()
        ai +=1
        c +=1
        #print(c+tmpc,'ja')
        #exit()
      if a[tmpai] > b[tmpbi]:
          st += b[bi]
          if st > K:
              print(c)
              exit()
          bi += 1
          c += 1
          break
      elif a[tmpai] < b[tmpbi]:
          st += a[ai]
          if st > K:
              print(c)
              exit()
          ai += 1
          c += 1
          break
      if tmpai == N-1 and tmpbi == M-1:
          print(N+M)
          exit()
      #print(tmpst)
      tmpc += 1
      #print(tmpai, tmpbi)
print(c)


Fixed submission:
a = int(input())
print(a+ a**2 + a**3)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
bcs = []
for i in range(Q):
  j,k = map(int,input().split())
  bcs.append([j,k])
cnts = [0]*100000
for a in A:
  cnts[a-1]+=1
for b,c in bcs:
  t = cnts[b-1]
  cnts[b-1]=0
  cnts[c-1]+=t
  s = 0
  for i in range(1,100001):
    s += cnts[i-1]*i
  print(s)

Fixed submission:
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
bcs = []
for i in range(Q):
  j,k = map(int,input().split())
  bcs.append([j,k])
s = sum(A)
cnts = [0]*100000
for a in A:
  cnts[a-1]+=1
for b,c in bcs:
  t = cnts[b-1]
  s -= t * b
  cnts[b-1]=0
  cnts[c-1]+=t
  s += t*c 
  print(s)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = input().split()
a = 1
for i in range(N):
  a *= int(li[i])
if a > 10 ** 18:
  print(-1)
else:
  print(a)


Fixed submission:
N = int(input())
li = input().split()
a = 1
sikataganai = False
try:
  h = li.index('0')
  print(0)
  sikataganai = True
except:
  for i in range(N):
    a *= int(li[i])
    if a > 10 ** 18:
      print(-1)
      exit()
  if not sikataganai :
    print(a)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
li = list(map(int,input().split()))
a = 1
for i in range(N):
  a *= li[i] 
if a > 10 ** 18:
  print(-1)
else:
  print(a)


Fixed submission:
N = int(input())
li = input().split()
a = 1
sikataganai = False
try:
  h = li.index('0')
  print(0)
  sikataganai = True
except:
  for i in range(N):
    a *= int(li[i])
    if a > 10 ** 18:
      print(-1)
      exit()
  if not sikataganai :
    print(a)

Buggy python submission (verdict: Runtime Error):
N = int(input())
a = 1
for i in range(N):
  a *= int(input())
if a > 10 ** 18:
  print(-1)
else:
  print(a)

Fixed submission:
N = int(input())
li = input().split()
a = 1
sikataganai = False
try:
  h = li.index('0')
  print(0)
  sikataganai = True
except:
  for i in range(N):
    a *= int(li[i])
    if a > 10 ** 18:
      print(-1)
      exit()
  if not sikataganai :
    print(a)
Buggy python submission (verdict: Runtime Error):
import math
A, B = input().split()
print(math.floor(Decimal(A)*Decimal(B)))

Fixed submission:
from decimal import *
import math
A, B = input().split()
print(math.floor(Decimal(A) * Decimal(B)))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())
H = list(map(int, input().split()))
AB = [sorted(list(map(int,input().split())))for i in range(M)]
AB.sort()
good = [True]*N
j = 0
for i in range(N):
    if not good[i]:
        continue
    while j < M:
        a,b = AB[j]
        if a+1 == i:
            if H[i] > H[b-1]:
                good[b-1] = False
            else:
                good[i] = False
            j +=1
        else:
            break
#print(good)
print(good.count(True))

Fixed submission:
print('ARC' if input() == 'ABC' else 'ABC')
Buggy python submission (verdict: Runtime Error):
N = int(input())
a={}
for i in range(N):
  a += input()
print(len(a))

Fixed submission:
N = int(input())
l = []
c = 0
for i in range(N):
  s = input()
  l.append(s)

a = set(l)
print(len(a))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
l = []
c = 0
for i in range(N):
  s = input()
  if s in l:
    continue
  c+=1
  l.append(s)
print(c)

Fixed submission:
N = int(input())
l = []
c = 0
for i in range(N):
  s = input()
  l.append(s)

a = set(l)
print(len(a))
Buggy python submission (verdict: Runtime Error):
import math
print(int(input()) * 2 * math.PI)

Fixed submission:
import math
print(int(input()) * 2 * math.pi)