Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
a=2
while True:
  if a<=n:
    a*=2

print(a/2)

Fixed submission:
n=int(input())
a=1
while True:
  if a<=n:
    a*=2
  else:
    break

print(a//2)
Buggy python submission (verdict: Runtime Error):
n,m=map(int,input().split())
sa={}
sb={}
for _ in range(m):
  a,b=map(int,input().split())
  if a==1:
    sa.add(b)
  if b==n:
    ab.add(a)
print("INPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE") 

Fixed submission:
n,m=map(int,input().split())
sa=set()
sb=set()
for _ in range(m):
  a,b=map(int,input().split())
  if a==1:
    sa.add(b)
  if b==n:
    sb.add(a)
print("IMPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE")
Buggy python submission (verdict: Runtime Error):
s=int(input())
n=len(s)//2
while n!=0:
  
  if s[:n]==s[n:2*n]:
    print(n)
    break
  n=-1

Fixed submission:
s=input()
n=len(s)//2
n-=1
while n!=0:
  if s[:n]==s[n:2*n]:
    print(2*n)
    break
  n-=1
Buggy python submission (verdict: Runtime Error):
a=list(input())
b=list(input())
c=list(input())
S=[a,b,c]
s=a
while True:
  s=S[s].pop()
print(s.upper())

Fixed submission:
S={c:list(input()) for c in "abc"}
s="a"
while S[s]:s=S[s].pop(0)
print(s.upper())
Buggy python submission (verdict: Runtime Error):
def dfs(i,f):
  if i == n-1:
    return sum(list(map(int,f.split("+"))))
  return dfs(i+1,f+s[i+1])+\dfs(i+1,f+"+"+s[i+1])
  
s= input()
n=len(s)
print(dfs(0,s[0]))


Fixed submission:
s=input()
n=len(s)
ans=0

for i in range(1<<(n-1)):
  f=s[0]
  for j in range(n-1):
    if i&(1<<j):
      f += "+"
    f+= s[j+1]
  ans += sum(map(int, f.split("+")))
  
print(ans)
Buggy python submission (verdict: Runtime Error):
k = int(raw_input())

print (k*str("ACL"))

Fixed submission:
k = int(input())

print (k*str("ACL"))

Buggy python submission (verdict: Runtime Error):
print("ACL"*int(inout()))

Fixed submission:
print("ACL"*int(input()))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

a = 0
while N > 0:
  a += N % 10
  N //= 10

if a % 9 == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
if int(input()) % 9 == 0:
  print("Yes")
else:
  print("No")

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

a = 0
while N > 0:
  a += N % 10
  N //= 10
  a %= 9

if a == 0:
  print("Yes")
else:
  print("No")


Fixed submission:
if int(input()) % 9 == 0:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())

a = 0
while N > 0:
  a += N % 10
  N /= 10
  a %= 9

if a == 0:
  print("Yes")
else:
  print("No")

Fixed submission:
if int(input()) % 9 == 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))

ans = 0
for i in range(N):
  if i % 2 == 0 AND A[i]%2 == 1:
    ans += 1
print(ans)

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

ans = 0
for i in range(N):
  if i % 2 == 0 and A[i]%2 == 1:
    ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())

AB = [tuple(map(int,input().split())) for i in range(M)]

es = [[] for _ in range(N)]
for a, b in AB:
    es[a-1].append(b-1)
    es[b-1].append(a-1)

ans = [-1] * N
ans[0] = 0

from collections import deque
que = deque
que.insert(0)

while que:
    s = que.popleft()
    for v in es[s]:
        if ans[v] == -1:
            ans[v] = s+1
            que.put(v)

print("Yes")
print(*ans[1:], sep="\n")

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

AB = [tuple(map(int,input().split())) for i in range(M)]

es = [[] for _ in range(N)]
for a, b in AB:
    es[a-1].append(b-1)
    es[b-1].append(a-1)

ans = [-1] * N
ans[0] = 0

import queue
que = queue.Queue()
que.put(0)

while que.qsize():
    s = que.get()
    for v in es[s]:
        if ans[v] == -1:
            ans[v] = s+1
            que.put(v)

print("Yes")
print(*ans[1:], sep="\n")
Buggy python submission (verdict: Time Limit Exceeded):
import math

K = int(input())

ans = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            ans += math.gcd(a, math.gcd(b, c))
print(ans)

Fixed submission:
import math

K = int(input())

ans = 0
for a in range(1, K+1):
    for b in range(1, K+1):
        for c in range(1, K+1):
            ans += math.gcd(a, math.gcd(b, c))
print(ans)
Buggy python submission (verdict: Runtime Error):
def solve():
    n = int(input())
    print(n+1)//2

solve()

Fixed submission:
def solve(n):
    return (n+1)//2

n = int(input())
print(solve(n))
Buggy python submission (verdict: Runtime Error):
import math

def solve():
    a, b = map(int, input().split())
    return a*b/math.gcd(a, b)

print(solve())

Fixed submission:
from fractions import gcd

def solve():
    a, b = map(int, input().split())
    return  a * b // gcd(a,b)

print(solve())

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

def solve():
    a, b = map(int, input().split())
    return a*b//math.gcd(a, b)

print(solve())

Fixed submission:
from fractions import gcd

def solve():
    a, b = map(int, input().split())
    return  a * b // gcd(a,b)

print(solve())

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

def solve():
    a, b = map(int, input().split())
    return a//math.gcd(a, b)*b

print(solve())

Fixed submission:
from fractions import gcd

def solve():
    a, b = map(int, input().split())
    return  a * b // gcd(a,b)

print(solve())
Buggy python submission (verdict: Runtime Error):
N, K = map(int,input().split())
sys.setrecursionlimit(500000)

T = [[] for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        bfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(500000)

N, K = map(int,input().split())

T = [[] for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        dfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)

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

T = [[]*N for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        bfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(500000)

N, K = map(int,input().split())

T = [[] for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        dfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)

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

T = [[] for i in range(N)]
for i in range(N-1):
    a,b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def bfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        bfs(j, b + cnt, 1, i)
        cnt += 1

bfs(0, 0, 0, -1)
print(ans)

Fixed submission:
import sys
sys.setrecursionlimit(500000)

N, K = map(int,input().split())

T = [[] for i in range(N)]
for i in range(N-1):
    a, b = map(int,input().split())
    T[a-1].append(b-1)
    T[b-1].append(a-1)

ans = 1
def dfs(i, bb, b, p):
    global ans
    ans = (ans*(K-bb-b))%(10**9+7)
    cnt = 0
    for j in T[i]:
        if j == p:
            continue
        dfs(j, b + cnt, 1, i)
        cnt += 1

dfs(0, 0, 0, -1)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
for i in range(1, N+1):
    heihoukon = math.floor(math.sqrt(i))
    tmp = 0
    for x in range(1, heihoukon):
        for y in range(1, heihoukon):
            for z in range(1, heihoukon):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
                    tmp += 1
                if x**2 + y**2 + z**2 + x*y + y*z + z*x > i:
                    break
    print(tmp)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
ans = [0 for _ in range(0, 10050)]
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            n = i*i + j*j + k*k + i*j + j*k + k*i
            if n < 10050:
                ans[n] += 1
            else:
                continue
for i in range(1, N +1):
    print(ans[i])

Buggy python submission (verdict: Time Limit Exceeded):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
for i in range(1, N+1):
    heihoukon = math.floor(math.sqrt(i))
    tmp = 0
    for x in range(1, heihoukon):
        for y in range(1, heihoukon):
            for z in range(1, heihoukon):
                if x**2 + y**2 + z**2 + x*y + y*z + z*x == i:
                    tmp += 1
    print(tmp)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
ans = [0 for _ in range(0, 10050)]
for i in range(1, 101):
    for j in range(1, 101):
        for k in range(1, 101):
            n = i*i + j*j + k*k + i*j + j*k + k*i
            if n < 10050:
                ans[n] += 1
            else:
                continue
for i in range(1, N +1):
    print(ans[i])
Buggy python submission (verdict: Time Limit Exceeded):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
from operator import mul
from functools import reduce
N = I()
A = LI()
ans = reduce(mul, A)
if ans > 10**18:
    ans = -1
print(ans)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
ans = A[0]
if 0 in A:
    ans = 0
else:
    for i in range(1, N):
        if ans > 10**18:
            ans = -1
            break
        else:
            ans = ans*A[i]
if ans > 10**18:
    ans = -1
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
ans = A[0]
for i in range(1, N):
    ans = ans*A[i]
if ans > 10**18:
    ans = -1
print(ans)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A = LI()
ans = A[0]
if 0 in A:
    ans = 0
else:
    for i in range(1, N):
        if ans > 10**18:
            ans = -1
            break
        else:
            ans = ans*A[i]
if ans > 10**18:
    ans = -1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import math
from collections import deque
a, b, n = map(int, input().split())
d = deque(list(math.floor(a*i/b)- a * math.floor(i/b) for i in range(1, n+1)))
print(max(d))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
ans = math.floor(a*x/b)- a * math.floor(x/b)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a, b, n = map(int, input().split())
li = list(math.floor(a*i/b)- a * math.floor(i/b) for i in range(1, n+1))
print(max(li))

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
ans = math.floor(a*x/b)- a * math.floor(x/b)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
a, b, n = map(int, input().split())
max_i = 0
for i in range(1, n+1):
    tmp = math.floor(a*i/b)- a * math.floor(i/b)
    if tmp > max_i:
        max_i = tmp
print(max_i)

Fixed submission:
import math
a, b, n = map(int, input().split())
x = min(b-1, n)
ans = math.floor(a*x/b)- a * math.floor(x/b)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split())) #list
for i in range(1, n+1):
    print(li.count(i))

Fixed submission:
import collections
n = int(input())
li = list(map(int, input().split())) #list
c = collections.Counter(li)
for i in range(1, n+1):
    print(c[i])
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

a, b, m = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
m_list = [list(map(int, input().split())) for _ in range(m)]
kumiawase_kingaku = float('inf')
for ab in itertools.product(a_list, b_list):
    if ab[0] + ab[1] < kumiawase_kingaku:
        kumiawase_kingaku = ab[0] + ab[1]

for x, y, c in m_list:
    reizouko = a_list[x-1]
    denshirenji = b_list[y-1]
    kingaku = reizouko + denshirenji - c
    if kingaku < kumiawase_kingaku:
        kumiawase_kingaku = kingaku

print(kumiawase_kingaku)


Fixed submission:
import itertools

a, b, m = map(int, input().split())
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))
m_list = [list(map(int, input().split())) for _ in range(m)]

kumiawase_kingaku = min(a_list) + min(b_list)

for x, y, c in m_list:
    reizouko = a_list[x-1]
    denshirenji = b_list[y-1]
    kingaku = reizouko + denshirenji - c
    if kingaku < kumiawase_kingaku:
        kumiawase_kingaku = kingaku

print(kumiawase_kingaku)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
li = list(map(int, input().split()))
ans = 0
kara = []
li.sort(reverse=True)
if n <= k:
  print(ans)
else:
  for i in range(k):
    li.pop(0)

  if li != kara:
    for j in li:
      ans += j

  print(ans)

Fixed submission:
n, k = map(int, input().split())
li = list(map(int, input().split()))
ans = 0
kara = []
if n <= k:
  print(ans)
else:
  li.sort(reverse=True)
  x = li[k:]
  ans = sum(x)

  print(ans)
Buggy python submission (verdict: Runtime Error):
X = int(input())
max_num = 100005
ans = 0
for i in range(X, max_num):
    if prime_check(i):
        print(i)
        break

def prime_check(num):
    for i in range(2, num):
        if num % i == 0:
            return False

    return True

Fixed submission:
X = int(input())
max_num = 100004
ans = 0
for i in range(X, max_num):
    cnt = 0
    for j in range(2, i+1):
        if i%j==0:
            cnt += 1
    if cnt == 1:
        ans = i
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,string
import sys
 
def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = lcm(a, b)
print(ans)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = lcm(a, b)
print(ans)

Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,string
import sys

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = lcm(a, b)
print(ans)

Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
import fractions
 
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
 
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b = M()
ans = lcm(a, b)
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if a + b + c < 22:
  print('win')
  else:
    print('bust')

Fixed submission:
a, b, c = map(int, input().split())
if a + b + c < 22:
  print('win')
else:
  print('bust')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
ans_li = [0] * n
for i in range(1, n+1):
    ans_li[i-1] = (li.index(i)+1)
print(*ans_li)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
ans_li = [0] * n
for i in range(n):
    ans_li[li[i]-1] = i+1
print(*ans_li)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import deque
n = int(input())
li = list(map(int, input().split()))
ans_li = deque()
for i in range(1, n+1):
    ans_li.append(li.index(i)+1)
print(*ans_li)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
ans_li = [0] * n
for i in range(n):
    ans_li[li[i]-1] = i+1
print(*ans_li)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
li = list(map(int, input().split()))
ans_li = []
for i in range(1, n+1):
    ans_li.append(li.index(i)+1)
print(*ans_li)

Fixed submission:
n = int(input())
li = list(map(int, input().split()))
ans_li = [0] * n
for i in range(n):
    ans_li[li[i]-1] = i+1
print(*ans_li)
Buggy python submission (verdict: Time Limit Exceeded):
n, m = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(m)] #n行に１つずつ入力される整数
num_li = [idx for idx in range(10**5+1)]
for l, r in li:
    temp_li = [i for i in range(l, r+1)]
    num_li = set(temp_li) & set(num_li)
print(len(num_li))

Fixed submission:
n, m = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(m)] #n行に１つずつ入力される整数
l_li = []
r_li = []
for l, r in li:
    l_li.append(l)
    r_li.append(r)
print(max(min(r_li) - max(l_li) +1, 0))
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
li = []
for i in range(a, b+1):
    if i < a+k or i > b-(k):
        li.append(i)
s = set(li)
d = sorted(s)
for x in d:
    print(x)

Fixed submission:
a, b, k = map(int, input().split())
li = []
for i in range(a, a+k):
    if a <= i <= b:
        li.append(i)
for j in range(b-k+1, b+1):
    if a <= i <= b:
        li.append(j)
s = set(li)
d = sorted(s)
for x in d:
    print(x)
Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A1 = LI()
A2 = LI()
ans = 0
for i in range(N):
    tmp = sum(A1[0:i+1]) + sum(A2[i:])
    ans = max(ans, tmp)
print(ans)


Fixed submission:
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
N = I()
A1 = LI()
A2 = LI()
ans = 0
for i in range(N):
    tmp = sum(A1[0:i+1]) + sum(A2[i:])
    ans = max(ans, tmp)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N = int(input())
li = list(map(int, input().split()))
ans = math.inf
for i in li:
    cnt = 0
    if i%2==0:
        tudukeru = True
    else:
        tudukeru = False
        ans = 0
    while tudukeru:
        if i%2 == 0:
            i = i//2
            cnt += 1
        else:
            tudukeru = False
            if cnt < ans:
                ans = cnt
print(ans)

Fixed submission:
N = int(input())
li = list(map(int, input().split()))
ans = float('inf')
for i in li:
    cnt = 0
    if i%2==0:
        tudukeru = True
    else:
        tudukeru = False
        ans = 0
    while tudukeru:
        if i%2 == 0:
            i = i//2
            cnt += 1
        else:
            tudukeru = False
            if cnt < ans:
                ans = cnt
print(ans)
Buggy python submission (verdict: Runtime Error):
import bisect,collections,copy,heapq,itertools,math,numpy,string
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
q, h, s, d = map(int, sys.stdin.readline().rstrip().split())
N = I()
D = d
qh = min(2*q, h)
S = min(2*qh, s)
x = min(2*S, D)
if N%2 == 0:
    print(N//2*x)
else:
    print(N//2*x + S)

Fixed submission:
import sys
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
q, h, s, d = map(int, sys.stdin.readline().rstrip().split())
N = I()
D = d
qh = min(2*q, h)
S = min(2*qh, s)
x = min(2*S, D)
if N%2 == 0:
    print(N//2*x)
else:
    print(N//2*x + S)