Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
# coding : utf-8

import numpy as np

N = int(input())
D = input().split()
D = [int(i) for i in D]

for i in range(N):
    suml = 0
    start = 0
    for j in range(N):
        if i == j:
            continue
        suml += abs(start - D[j])
        start = D[j]
    print(suml+abs(start))


Fixed submission:
# coding : utf-8

import numpy as np

N = int(input())
D = input().split()
D = [int(i) for i in D]

alll = 0
start = 0
for i in range(N):
    alll += abs(D[i] - start)
    start = D[i]
alll += abs(start)

diff = abs(D[0]) + abs(D[1] - D[0])
net = abs(D[1])
print(alll - diff + net)
for i in range(1,N-1):
    diff = abs(D[i-1] - D[i]) + abs(D[i] - D[i+1])
    net = abs(D[i-1] - D[i+1])
    print(alll - diff + net)
diff = abs(D[N-2] - D[N-1]) + abs(D[N-1])
net = abs(D[N-2])
print(alll - diff + net)
Buggy python submission (verdict: Runtime Error):
# coding:utf-8

in1 = input().split()

in1 = [int(i) for i in in1]

if(in1[0]==1 fand in1[1]==1):
    print("1")
elif(in1[0]==1 or in1[1]==1):
    print((in1[0]-2)*(in1[1]-2)*(-1))
else:
    print((in1[0]-2)*(in1[1]-2))

Fixed submission:
# coding:utf-8

in1 = input().split()

in1 = [int(i) for i in in1]

if(in1[0]==1 and in1[1]==1):
    print("1")
elif(in1[0]==1 or in1[1]==1):
    print((in1[0]-2)*(in1[1]-2)*(-1))
else:
    print((in1[0]-2)*(in1[1]-2))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
input = stdin

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


Fixed submission:
from sys import stdin
input = stdin.readline

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

Buggy python submission (verdict: Runtime Error):
from sys import stdin
input = sys.stdin

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

Fixed submission:
from sys import stdin
input = stdin.readline

n = int(input())
aa = list(map(int, input().split()))
if 0 in aa:
  print(0)
  exit()
ans = 1
for a in aa:
  ans *= a
  if ans > 10**18:
    print(-1)
    exit()
print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    import numpy as np
    # import math
    # import random
    input = stdin.readline


    n, k = map(int, input().split())
    aa = [0]+list(map(int, input().split()))
    arrive = [1]
    next = aa[1]
    visited = set([1])
    if next == 1:
        print(1)
        exit()
    while not (next in visited):
        arrive.append(next)
        visited.add(next)
        next = aa[next]
    num_town = len(arrive)
    start_index = arrive.index(next)
    if k <= num_town:
        print(arrive[k])
        exit()
    print(arrive[start_index+(k-start_index)%(num_town-start_index)])



Fixed submission:
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    import numpy as np
    # import math
    # import random
    input = stdin.readline


    n, k = map(int, input().split())
    aa = [0]+list(map(int, input().split()))
    arrive = [1]
    next = aa[1]
    visited = set([1])
    if next == 1:
        print(1)
        exit()
    while not (next in visited):
        arrive.append(next)
        visited.add(next)
        next = aa[next]
    num_town = len(arrive)
    start_index = arrive.index(next)
    if k < num_town:
        print(arrive[k])
        exit()
    print(arrive[start_index+(k-start_index)%(num_town-start_index)])
Buggy python submission (verdict: Time Limit Exceeded):
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    # import numpy as np
    import math
    # import random
    input = stdin.readline

    p = 998244353

    def pow_k(x, n):
        """
        O(log n)
        """
        if n == 0:
            return 1

        K = 1
        while n > 1:
            if n % 2 != 0:
                K *= x
                K = K%p
            x *= x
            n //= 2

        return (K * x)%p

    n, m, k = map(int, input().split())
    if m == 1:
        if k < n-1:
            print(0)
        else:
            print(1)
        exit()

    ans = 0
    first = pow_k(m-1, n-k-1)
    first_cmb = math.factorial(n-1) // math.factorial(k) // math.factorial(n - k-1)
    for i in range(k, -1, -1):
        ans += (first_cmb*first)%p
        first = (first*(m-1))%p
        first_cmb = (first_cmb*i)//(n-i)
    ans = ans*m
    print(ans%p)



Fixed submission:
if __name__ == '__main__':
    from sys import stdin
    # from collections import defaultdict
    # from collections import deque
    # from collections import Counter
    # import numpy as np
    import math
    # import random
    input = stdin.readline

    p = 998244353

    def cmb(n, r, p):
        if (r < 0) or (n < r):
            return 0
        r = min(r, n - r)
        return fact[n] * factinv[r] * factinv[n-r] % p

    # p = 10 ** 9 + 7
    N = 10 ** 6  # N は必要分だけ用意する
    fact = [1, 1]  # fact[n] = (n! mod p)
    factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
    inv = [0, 1]  # factinv 計算用
    
    for i in range(2, N + 1):
        fact.append((fact[-1] * i) % p)
        inv.append((-inv[p % i] * (p // i)) % p)
        factinv.append((factinv[-1] * inv[-1]) % p)

    def pow_k(x, n):
        """
        O(log n)
        """
        if n == 0:
            return 1

        K = 1
        while n > 1:
            if n % 2 != 0:
                K *= x
                K = K%p
            x *= x
            n //= 2

        return (K * x)%p

    n, m, k = map(int, input().split())
    if m == 1:
        if k < n-1:
            print(0)
        else:
            print(1)
        exit()

    ans = 0
    first = pow_k(m-1, n-k-1)
    for i in range(k, -1, -1):
        first_cmb = cmb(n-1, i, p)
        ans += (first_cmb*first)%p
        first = (first*(m-1))%p
        # first_cmb = (first_cmb*i)//(n-i)
        


    ans = ans*m
    print(ans%p)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    from collections import deque


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

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

    if n == 1:
        a = aa.popleft()
        for _ in range(m):
            a = a // 2
        print(a)
        exit()

    top = aa.popleft()

    deque_list = [aa, deque()]
    top_list = [deque_list[0].popleft(), top//2]


    for _ in range(m-1):
        max_num = max(top_list)
        max_index = top_list.index(max_num)
        try:
            deque_list[max_index+1].append(max_num//2)
        except IndexError:
            deque_list.append(deque())
            top_list.append(max_num//2)
        if top_list[max_index+1] == 0:
            top_list[max_index+1] = deque_list[max_index+1].popleft()
        try:
            top_list[max_index] = deque_list[max_index].popleft()
        except IndexError:
            top_list[max_index] = 0

    ans = sum(top_list)
    for one_deque in deque_list:
        ans += sum(one_deque)
    print(ans)


Fixed submission:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline

    from collections import deque


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

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

    if n == 1:
        a = aa.popleft()
        for _ in range(m):
            a = a // 2
        print(a)
        exit()

    top = aa.popleft()

    deque_list = [aa, deque()]
    top_list = [deque_list[0].popleft(), top//2]


    for _ in range(m-1):
        max_num = max(top_list)
        max_index = top_list.index(max_num)
        try:
            deque_list[max_index+1].append(max_num//2)
        except IndexError:
            deque_list.append(deque())
            top_list.append(max_num//2)
        if top_list[max_index+1] == -1:
            top_list[max_index+1] = deque_list[max_index+1].popleft()
        try:
            top_list[max_index] = deque_list[max_index].popleft()
        except IndexError:
            top_list[max_index] = -1

    ans = 0
    for num in top_list:
        ans += max(0, num)
    for one_deque in deque_list:
        ans += sum(one_deque)
    print(ans)
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    import collections
    n, k = map(int, input().split())
    td = [list(map(int, input().split())) for _ in range(n)]
    td.sort(key=lambda x: x[1], reverse=True)
    ans_list = [0]
    reverse_td = list(zip(*td))
    c = collections.Counter(reverse_td[0][:k])
    kind = len(c)
    ans = sum(reverse_td[1][:k])+kind**2
    check = k-1
    flag=False
    for i in range(k,n):
        t = td[i][0]
        d = td[i][1]
        if t in c:
            pass
        else:
            c[t]=1
            while True:
                new_t = td[check][0]
                if c[new_t]==1:
                    check -=1
                    if check == -1:
                        flag =True
                        break
                else:
                    c[new_t]-=1
                    ans_list.append(2*kind+1+d-td[check][1])
                    kind+=1
            if flag:
                break
    print(ans+max(ans_list))


Fixed submission:
if __name__ == '__main__':
    n, w, k = map(int, input().split())
    print(int(n*w/2))
Buggy python submission (verdict: Runtime Error):
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    n = int(input())
    hs = list(map(int, input().split()))
    hs = hs[::-1]
    def jump(p):
        if p == 1:
            return 0
        elif p == 2:
            return abs(hs[1]-hs[0])
        else:
            return min([jump(p-1)+abs(hs[p-1]-hs[p-2]), jump(p-2)+abs(hs[p-1]-hs[p-3])])
    print(jump(n))


Fixed submission:
if __name__ == '__main__':
    import sys
    input = sys.stdin.readline
    n = int(input())
    hs = list(map(int, input().split()))
    hs = hs[::-1]
    ans_list = [0]*n
    ans_list[1] = abs(hs[1]-hs[0])
    for i in range(2,n):
        ans_list[i] = min([ans_list[i-1]+abs(hs[i]-hs[i-1]), ans_list[i-2]+abs(hs[i]-hs[i-2])])
    print(ans_list[n-1])
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = []
for _ in range(n):
  p.append(int(input()))
count = 0
for i in p:
  count += i
print(int(count-max(p)/2))

Fixed submission:
d = input()
if d == '25':
  print('Christmas')
elif d == '24':
  print('Christmas Eve')
elif d=='23':
  print('Christmas Eve Eve')
elif d == '22':
  print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
count = 0
for i in range(1, N+1):
  x = str(i)
  if '1' not in x and '2' not in x and '4' not in x and '6' not in x and '8' not in x and '9' not in x and '0' not in x and '3' in x and '5' in x and '7' in x:
    count += 1
print(count)

Fixed submission:
n = int(input())
count = 0
base = [[0],[],[],[],[],[],[],[],[],[],[]]
for digit in range(10):
  for i in base[digit]:
    num_3 = i+3*10**digit
    num_5 = i+5*10**digit
    num_7 = i+7*10**digit
    next_digit = digit + 1
    if num_3 <= n:
      if set(str(num_3)) == {'3','5','7'}:
        count += 1
      base[next_digit].append(num_3)
    if num_5 <= n:
      if set(str(num_5)) == {'3','5','7'}:
        count += 1
      base[next_digit].append(num_5)
    if num_7 <= n:
      if set(str(num_7)) == {'3','5','7'}:
        count += 1
      base[next_digit].append(num_7)
print(count)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
cities = []
for _ in range(m):
  cities.append(list(map(int, input().split())))
  sort_cities = sorted(cities, key=lambda x:x[1])
pre = [0 for _ in range(n)]
ans = {}
for city in sort_cities:
  pre[city[0]-1]+=1
  ans[(6-len(str(city[0])))*'0'+str(city[0])+str(city[1])] = (6-len(str(city[0])))*'0'+str(city[0])+(6-len(str(pre[city[0]-1])))*'0'+str(pre[city[0]-1])
for a in cities:
  print(ans[(6-len(str(a[0])))*'0'+str(a[0])+str(a[1])])

Fixed submission:
import sys
input = sys.stdin.readline
n, m = map(int, input().split())
cities = []
for _ in range(m):
  cities.append(list(map(int, input().split())))
sort_cities = sorted(cities, key=lambda x:x[1])
pre = [0 for _ in range(n)]
ans = {}
for city in sort_cities:
  pre[city[0]-1]+=1
  st_city = str(city[0])
  st_pre = str(pre[city[0]-1])
  len_0 = (6-len(st_city))*'0'
  ans[len_0+st_city+str(city[1])] = len_0+st_city+(6-len(st_pre))*'0'+st_pre
for a in cities:
  print(ans[(6-len(str(a[0])))*'0'+str(a[0])+str(a[1])])
Buggy python submission (verdict: Runtime Error):
import math

 
A,B,H,M= list(map(int, input().split()))
 
theta = 2*math.pi*H/12+2*math.pi*M/12/60 #時針の角度
phi = 2*math.pi*M/60 #分針の角度
  
C = math.sqrt(A**2+B**2-2*A*B*math.cos(theta-phi))
print(C)

Fixed submission:
'''
1の位が2,4,5,7,9のとき'hon'
1の位が0,1,6,8のとき'pon'
1の位が3のとき'bon'
を出力する．
'''

def kazoekata_enpitsu(N):
    if(N%10==3):
        print('bon')
    elif(N%10==0 or N%10==1 or N%10==6 or N%10==8):
        print('pon')
    else:
        print('hon')

N = int(input())
kazoekata_enpitsu(N)
Buggy python submission (verdict: Runtime Error):
import math
'''
時針：Aセンチ，12時間で1周
分針：Bセンチ，1時間で1周
0時ちょうどに針は重なっていた．H時M分のとき，2本の針の端点は何センチ離れているか．
'''
 
A,B,H,M= list(map(int, input().split()))
 
theta = 2*math.pi*H/12+2*math.pi*M*/12/60 #時針の角度
phi = 2*math.pi*M/60 #分針の角度
 
deff_rad = 2*math.pi*(M/60 - H/12)
 
C = math.sqrt(A**2+B**2-2*A*B*math.cos(deff_rad))


Fixed submission:
import math

a, b, h, m = list(map(int, input().split()))
deg_a = (60 * h + m) * (360 / (60 * 12))
deg_b = m * (360 / 60)
deg = abs(deg_a - deg_b)
rad = math.radians(deg)

c2 = a ** 2 + b ** 2 - 2 * a * b * math.cos(rad)
print(c2 ** 0.5)
Buggy python submission (verdict: Time Limit Exceeded):
A, B, C, K = list(map(int, input().split( )))
max_score = 0

while(K != 0):
    if(A == 0 and B == 0 and C > 0):
        C -= 1
        max_score += -1
    if(A == 0 and B > 0):
        B -= 1
    if(A > 0):
        A -= 1
        max_score += 1
    K -= 1

print(max_score)

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

if(K < A):
    score = K
elif(K >= A and K <= A+B):
    score = A
else:
    score = A - (K - A - B)

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

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

D_seq_max = max(D_seq)

judge_list = np.arange(D_seq_max+1)
judge_set = set(judge_list)
D_seq_set = set(D_seq)

c = collections.Counter(D_seq)

N_list = []
if((judge_set == D_seq_set)or(D_seq[0]==0)):
    counts = 1
    for i in range(D_seq_max):
        counts *= pow(c[i], c[i+1])
    if(counts < 998244353):    
        print(counts)
    else:
        print(int(counts%998244353))
        
else:
    print(0)

Fixed submission:
import math
import numpy as np

N = int(input())

N_half = math.floor(N/2)

counts = 0
for i in np.arange(1, N):
    j = N-i
    if(i != j ):
        counts += 1
        
print(int(counts/2))
Buggy python submission (verdict: Runtime Error):
import math
import numpy as np
from functools import reduce

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

D_seq_max = max(D_seq)

judge_list = np.arange(D_seq_max+1)
judge_set = set(judge_list)
D_seq_set = set(D_seq)

N_list = [1]
if((judge_set == D_seq_set)or(D_seq[0]==0)):
    for i in range(D_seq_max):
        N_list.append(D_seq.count(i+1))
    counts = reduce(pow, N_list)
    for i in range(len(N_list)-1):
        counts *= pow(N_list[i], N_list[i+1])
    if(counts < 998244353):    
        print(counts)
    else:
        print(int(counts/998244353))
        
else:
    print(0)

Fixed submission:
import numpy as np
import collections

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

D_seq_max = max(D_seq)

judge_list = np.arange(D_seq_max+1)
judge_set = set(judge_list)
D_seq_set = set(D_seq)

c = collections.Counter(D_seq)

N_list = []
if((judge_set == D_seq_set)and(D_seq[0]==0)):
    if(c[0]>1):
        print(0)
    else:
        counts = 1
        for i in range(D_seq_max):
            counts *= pow(c[i], c[i+1])
        if(counts < 998244353):    
            print(counts)
        else:
            print(int(counts%998244353))
else:
    print(0)

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

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

D_seq_max = max(D_seq)

judge_list = np.arange(D_seq_max+1)
judge_set = set(judge_list)
D_seq_set = set(D_seq)

N_list = []
if((judge_set == D_seq_set)or(D_seq[0]==0)):
    for i in range(D_seq_max):
        N_list.append(D_seq.count(i+1))
    counts = 1
    for i in range(len(N_list)-1):
        counts *= pow(N_list[i], N_list[i+1])
    if(counts < 998244353):    
        print(counts)
    else:
        print(int(counts/998244353))
        
else:
    print(0)

Fixed submission:
import numpy as np
import collections

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

D_seq_max = max(D_seq)

judge_list = np.arange(D_seq_max+1)
judge_set = set(judge_list)
D_seq_set = set(D_seq)

c = collections.Counter(D_seq)

N_list = []
if((judge_set == D_seq_set)and(D_seq[0]==0)):
    if(c[0]>1):
        print(0)
    else:
        counts = 1
        for i in range(D_seq_max):
            counts *= pow(c[i], c[i+1])
        if(counts < 998244353):    
            print(counts)
        else:
            print(int(counts%998244353))
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

count = 0
ar = [0] * (N)
br = [0] * (M)

ar[0] = A[0]
for i, v in enumerate(A):
    ar[i+1] = ar[i] + v

br[0] = B[0]
for i, v in enumerate(B):
    br[i+1] = br[i] + v

max_read = 0
j = M
for i in range(N+1):
    rest = K - ar[i]
    if rest <= 0:
        break
    while br[j] > K - ar[i]:
        j -= 1

    max_read = max(max_read, i+j)

print(max_read)


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

count = 0
ar = [0] * (N + 1)
br = [0] * (M + 1)

for i, v in enumerate(A):
    ar[i+1] = ar[i] + v

for i, v in enumerate(B):
    br[i+1] = br[i] + v

max_read = 0
j = M
for i in range(N+1):
    if ar[i] > K:
        break
    while br[j] > K - ar[i]:
        j -= 1
    max_read = max(max_read, i+j)

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

m = a[0]
for i in a[1:]:
    m *= i

if m > pow(10, 18):
    print("-1")
else:
    print(m)

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

if 0 in a:
    print("0")
    exit()

m = a[0]
over = False
limit = pow(10, 18)
for i in a[1:]:
    m *= i
    if m > limit:
        over = True
        break

if over:
    print("-1")
else:
    print(m)
Buggy python submission (verdict: Runtime Error):
n = input()

last = int(n[-1])

bon = [3]
pon = [0, 1, 6, 8]

if last in bon:
    print("bon")
else if last in pon:
    print("pon")
else:
    print("hon")


Fixed submission:
n = input()

last = int(n[-1])

bon = [3]
pon = [0, 1, 6, 8]

if last in bon:
    print("bon")
elif last in pon:
    print("pon")
else:
    print("hon")
Buggy python submission (verdict: Time Limit Exceeded):
apples = [(0, 'X') for x in range(300001)]
apples_idx = 0

def append_a(n):
    global apples
    global apples_idx
    apples[apples_idx] = (n, 'A')
    apples_idx += 1

def append_b(n):
    global apples
    global apples_idx
    apples[apples_idx] = (n, 'B')
    apples_idx += 1

def append_c(n):
    global apples
    global apples_idx
    apples[apples_idx] = (n, 'C')
    apples_idx += 1
    
X, Y, A, B, C = map(int, input().split())
for i in input().split():
    append_a(int(i))

for i in input().split():
    append_b(int(i))

for i in input().split():
    append_c(int(i))

apples.sort(reverse=True)
xn, yn = 0, 0
value = 0

for i, apple in enumerate(apples):
    if xn == X and yn == Y:
        break
    if apple[1] == 'A':
        if xn == X:
            continue
        xn += 1
        value += apple[0]
        continue
    if apple[1] == 'B':
        if yn == Y:
            continue
        yn += 1
        value += apple[0]
        continue

    # Apple C
    next_type = 'C'
    if xn < X and yn < Y:
        for j in range(i+1, len(apples)):
            if apples[j][1] == 'A':
                next_type = 'A'
            elif apples[j][1] == 'B':
                next_type = 'B'
    elif xn < X:
        next_type = 'A'
    else:
        next_type = 'B'

    if next_type == 'A':
        xn += 1
        value += apple[0]
    else:
        yn += 1
        value += apple[0]

print(value)



Fixed submission:
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)

apples = p[:X] + q[:Y] + r
apples.sort(reverse=True)

value = sum(apples[:X+Y])
print(value)
Buggy python submission (verdict: Time Limit Exceeded):
import decimal

def volume(h, w, v):
    return h * w * v

L = decimal.Decimal(input())

max_volume = 0
max_list = []
i = decimal.Decimal(L/3) - 1
if i < 0:
    i = decimal.Decimal(0.01)

while i < L/3+1:
    j = decimal.Decimal(L/3) - 1
    if j < 0:
        j = decimal.Decimal(0.01)
    while j < L/3 + 1:
        k = decimal.Decimal(L - i - j)
        v = volume(i, j, k)
        if max_volume < v:
            max_volume = v
            max_list = [i, j, k]
        j += decimal.Decimal(0.01)
    i += decimal.Decimal(0.01)

print(max_volume)

Fixed submission:
import decimal

def volume(h, w, v):
    return h * w * v

L = decimal.Decimal(input())

i = decimal.Decimal(L/3)
j = decimal.Decimal(L/3)
k = decimal.Decimal(L/3)
max_volume = volume(i, j, k)
while k <= decimal.Decimal(L/3) + 1:
    if i + j + k > L:
        k += decimal.Decimal(0.01)
        continue
    v = volume(i, j, k)
    max_volume = max(max_volume, v)
    k += decimal.Decimal(0.01)

print(max_volume)
Buggy python submission (verdict: Time Limit Exceeded):
N, A, B = map(int, input().split())

all_count = 0
blue_count = 0

while all_count < N:
    if all_count + A >= N:
        blue_count += N - all_count
        break
    all_count += A
    all_count += B
    blue_count += A

print(blue_count)

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

operation_count = N // (A+B)
blue_count = A * operation_count
if N % (A+B) > 0:
    rest = N % (A+B)
    blue_count += min([rest, A])

print(blue_count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split(' ')))
bucket = [0]*1000000001

distinct = True
for i in a:
    if bucket[i] != 0:
        distinct = False
        break
    bucket[i] += 1
    
if distinct:
    print("Yes")
else:
    print('No')

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
m = {}

distinct = True
for i in a:
    if i in m:
        distinct = False
        break
    m[i] = 1
    
if distinct:
    print("YES")
else:
    print('NO')
Buggy python submission (verdict: Runtime Error):
import numpy

n = int(input())
a = list(map(int, input().split(' ')))

lcm = numpy.lcm.reduce(a)

s = 0
for i in range(n):
    s += lcm // a[i]

ans = s % 1000000007
print(ans)


Fixed submission:
from fractions import gcd

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

n = int(input())
a = list(map(int, input().split(' ')))

lcm = a[0]
for i in range(1, n):
    lcm = calc_lcm(lcm, a[i])

s = 0
for i in range(n):
    s += lcm // a[i]

ans = s % 1000000007
print(ans)