Harryxun/stf_run huggingface dataset:
def prime(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a





n=int(input(""))

if(n!=1):
    

    s=0

    t=0
    lista=prime(n)
    aa=len(lista)
    c=lista[0]
    for i in lista:
        if (c==i):
            t+=1
        else:
            k=1
            while(t>=k):
                t-=k
                s+=1
                k+=1
            t=1
            c=i

    if(t!=1):
        k=1
        while(t>=k):
            t-=k
            s+=1
            k+=1
        


            
        
        
    
    
if(n==1):
    s==0

print(s)
    
        
            
            
    
    


### FIXED CODE ###

def prime(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a





n=int(input(""))
s=0
if(n!=1):
    

    

    t=0
    lista=prime(n)
    #print(lista)
    
    c=lista[0]
    for i in lista:
        if (c==i):
            t+=1
        else:
            k=1
            while(t>=k):
                t-=k
                s+=1
                k+=1
            t=1
            c=i


    k=1
    while(t>=k):
        t-=k
        s+=1
        k+=1
        


            
        
        
    
    


print(s)
a,b,k=map(int,input().split())

ab = list(range(a,b+1))
nums = set(ab[:k]+ab[-k:])

for i in sorted(list(nums)):
  print(i)

### FIXED CODE ###

a,b,k=map(int,input().split())


ans = []
for ai in range(a,a+k):
  if ai <= b:
    ans.append(ai)
for bi in range(b,b-k,-1):
  if bi >=a:
    ans.append(bi)
    
for i in sorted(list(set(ans))):
  print(i)
def convert(S):
    return eval(S.replace(")[","),[").replace("](","],("))
def dfs(A, B):
    if not A or not B:
        return ()
    return (dfs(A[0], B[0]), [A[1][0] + B[1][0]], dfs(A[2], B[2]))
print(str(dfs(convert(input()), convert(input()))).replace(", ","")[1:-1])

### FIXED CODE ###

def convert(S):
    cur = 0
    def parse():
        nonlocal cur
        if S[cur] == ')':
            return ()
        cur += 1 # '('
        left = parse()
        cur += 2 # ')['
        num = 0
        while S[cur] != ']':
            num = 10*num + int(S[cur])
            cur += 1
        cur += 2 # ']('
        right = parse()
        cur += 1 # ')'
        return left, num, right
    return parse()
def dfs(A, B):
    if not A or not B:
        return ()
    return (dfs(A[0], B[0]), [A[1] + B[1]], dfs(A[2], B[2]))
print(str(dfs(convert(input()), convert(input()))).replace(", ","")[1:-1])
import sys string = str() for line in sys.stdin: string += line.lower() alph = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] for letter in alph: sum = 0 n = -1 while True: n = string.find(letter, n + 1) if n == -1: break sum += 1 print("{} : {}".format(letter, sum)) 


### FIXED CODE ###

import sys
S= sys.stdin.read()
print('a : '+str(S.count('a')+S.count('A')))
print('b : '+str(S.count('b')+S.count('B')))
print('c : '+str(S.count('c')+S.count('C')))
print('d : '+str(S.count('d')+S.count('D')))
print('e : '+str(S.count('e')+S.count('E')))
print('f : '+str(S.count('f')+S.count('F')))
print('g : '+str(S.count('g')+S.count('G')))
print('h : '+str(S.count('h')+S.count('H')))
print('i : '+str(S.count('i')+S.count('I')))
print('j : '+str(S.count('j')+S.count('J')))
print('k : '+str(S.count('k')+S.count('K')))
print('l : '+str(S.count('l')+S.count('L')))
print('m : '+str(S.count('m')+S.count('M')))
print('n : '+str(S.count('n')+S.count('N')))
print('o : '+str(S.count('o')+S.count('O')))
print('p : '+str(S.count('p')+S.count('P')))
print('q : '+str(S.count('q')+S.count('Q')))
print('r : '+str(S.count('r')+S.count('R')))
print('s : '+str(S.count('s')+S.count('S')))
print('t : '+str(S.count('t')+S.count('T')))
print('u : '+str(S.count('u')+S.count('U')))
print('v : '+str(S.count('v')+S.count('V')))
print('w : '+str(S.count('w')+S.count('W')))
print('x : '+str(S.count('x')+S.count('X')))
print('y : '+str(S.count('y')+S.count('Y')))
print('z : '+str(S.count('z')+S.count('Z')))
d,t,s=map(int,input()).split())
if s == 0:
    print("No")
elif d/s => t :
    print("Yes")
else:
    print("No")

### FIXED CODE ###

d,t,s=map(int,input().split())
if s == 0:
    print("No")
elif d/s <= t :
    print("Yes")
else:
    print("No")
N = int(input())
h_ = list(input().split())
h = [int(i) for i in h_]
cnt=[0]*(N-1)
ans=[0]*(N-1)
counter=1
if N==1:
  print(0)
else:
  for i in range(N-1):
    if h[i] >= h[i+1]:
      cnt[i]=counter
    else:
      counter+=1
for j in range(N-1):
  ans[j]=cnt.count(j)
print(max(ans))

### FIXED CODE ###

N = int(input())
H = [int(x) for x in input().split()]
dp = [0] * len(H) 
for i in range(1, len(H)):
  if H[i-1] >= H[i]: 
    dp[i] = dp[i-1] + 1
ans = max(dp)
print(ans)
N = input()
K = input()
X = input()
Y = input()

print(K*X+(N-K)*Y)


### FIXED CODE ###

N = input()
K = input()
X = input()
Y = input()
if(X < Y):
	tmp = X
	X = Y
	Y = tmp

if(N>K):
	print(K*X+(N-K)*Y)
else:
	print(N*X)
n,m=map(int,input().split())
A = [int(input()) for i in range(m)]
mod = 10**9+7
memo={}
memo[1]=1
memo[0]=1

def fib(n):
  if n in A:
  	memo[n]=0
  	return memo[n]
  if n not in memo:
    memo[n] = fib(n-1) + fib(n-2)
  return memo[n]

print(fib(n)%mod)

### FIXED CODE ###

n,m=map(int,input().split())
A = [int(input()) for i in range(m)]
ls =[-1]*(n+1)
ls[0]=ls[1]=1
mod = 10**9+7
for a in A:
	ls[a]= 0

for i in range(2,n+1):
	if ls[i]==-1:
		ls[i]= ls[i-1]+ls[i-2]
print(ls[-1]%mod)
a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0:
  if num%2 != 0:
    print("Positive")
  else:
  	print("Negative")
elif a < 0 and b > 0:
  if len(abs(a))%2 == 0:
  	print("Positive")
  else:
    print("Negative")
else:
  print("Zero")

### FIXED CODE ###

a, b = map(int,input().split())
num = (b-a)+1
if a > 0:
  print("Positive")
elif b < 0 and num%2==0:
  print("Positive")
elif b < 0 and num%2!=0:
  print("Negative")
elif a <= 0 and b >= 0:
  print("Zero")
N=int(input())
A=int(input())
B=int(input())
Answer=[]
for i in range(10):
    for j in range(10):
        for k in range(10):
            for l in range(10):
                if i*10**3+j*10**2+k*10+l<=N and A<=i+j+k+l<=B:
                    Answer.append(i*10**3+j*10**2+k*10+l)
print(sum(Answer))


### FIXED CODE ###

N,A,B=map(int,input().split())
ans=0 

for i in range(1,N+1):
    D=0
    for j in str(i):
        D+=int(j)
    if A<=D<=B:
        ans+=i
print(ans)
n,k = map(int, raw_input())
print n - k +1

### FIXED CODE ###

n,k = map(int, raw_input().split())
print n - k +1
N, M, C = map(int, input().split())
B = []
A = []

B.append(map(int, input().split()))
for i in range(N):
	A.append(list(map(int, input().split())))


sum = 0
count = 0

for i in range(N):
	sum = 0
	for j in range(M):
		sum += A[i][j]
		sum += B[j]
	sum += C
	if sum > 0:
		count += 1

print(sum)

### FIXED CODE ###

H,W = map(int, input().split())
h,w = map(int, input().split())

total = H* W
ans = total - (H*w + W*h - h*w) 
print (ans)
S = input()
T = input()

if S == T[:-2]:
  print("Yes")
  
else:
  print("No)

### FIXED CODE ###

S = input()
T = input()

if S == T[:-1]:
  print("Yes")
  
else:
  print("No")
n,a,b,ax,bx=int(input()),list(map(int,input().split()))+[0],list(map(int,input().split()))+[0],0,0
na,nb=a,b
for i in range(n):
	a[n]^=a[i]
	b[n]^=b[i]
a,b=sorted(a),sorted(b)
if sum([a[i]!=b[i] for i in range(n+1)]):
	print("-1")
	exit()
mp=dict()
ax,bx=0,0
f=[i for i in range(n+1)]
def find(x):
	if f[x]==x:
		return x
	else:
		return find(f[x])
for i in range(n+1):
	mp[a[i]]=i
frog=True
for i in range(n):
	if na[i]!=nb[i]:
		frog=False
		f[find(mp[nb[i]])]=find(mp[na[i]])
if frog:
	print("0")
	exit()
st=set()
for i in range(n+1):
	st.add(find(mp[a[i]]))
print(n+len(st)-1)

### FIXED CODE ###

n,a,b=int(input()),list(map(int,input().split()))+[0],list(map(int,input().split()))+[0]
for i in range(n):
	a[n]^=a[i]
	b[n]^=b[i]
na,nb=sorted(a),sorted(b)
if na!=nb:
	print("-1")
	exit()
f=dict()
def find(x):
	if f[x]==x:
		return x
	else:
		f[x]=find(f[x])
		return f[x]
ans=0
for i in range(n):
	if a[i]!=b[i]:
		f[a[i]]=a[i]
f[a[n]]=a[n]
for i in range(n):
	if a[i]!=b[i]:
		ans+=1
		f[find(b[i])]=find(a[i])
for i in f:
	if i==f[i]:
		ans+=1
print(ans-1)
a = int(input())
s= input()
if a>=3200:
  print(s)
else if:
  s = "red"
  print(s)

### FIXED CODE ###

a = int(input())
s = input()
if a>=3200:
  print(s)
else:
  print("red")
s=input().replace('/','').strip()
if s<=20190430:print('Heisei')
else:print('TBD')

### FIXED CODE ###

s=input().split('/')
if int(s[0])<2018:print('Heisei')
elif int(s[0])==2019 and int(s[1])<=4:print('Heisei')
else:print('TBD')
import heapq
N=int(input())
xy=[list(map(int,input().split()))+[i] for i in range(N)]
xy.sort()
path = []

def get_root(n):
    if tree[n][0] is None:return n
    return get_root(tree[n][0])

def in_tree(i,j):
    i = get_root(i)
    while i is not None:
        if   i == j : return True
        elif j < i  : i = tree[i][1]
        else        : i = tree[i][2]
    return False

def add_tree(i,j):
    i = get_root(i)
    j = get_root(j)
    c = i
    while c is not None:
        i = c
        if j < i : c = tree[i][1]
        else     : c = tree[i][2]
    tree[j][0] = i
    tree[i][1+(j>=i)] = j
    return

for k in range(N-1):
    x,y,i = xy[k]
    x2,y2,j = xy[k+1]
    if i>j:i,j = j,i
    heapq.heappush(path,(abs(x-x2),i,j))
xy.sort(key=lambda x:x[1])
for k in range(N-1):
    x,y,i = xy[k]
    x2,y2,j = xy[k+1]
    if i>j:i,j = j,i
    heapq.heappush(path,(abs(y-y2),i,j))
tree = [[None]*3 for _ in [0]*N] #Parent,l-child,r-child
cnt = 0
ans = 0
while cnt < N-1:
    c,i,j = heapq.heappop(path)
    if in_tree(i,j):continue
    add_tree(i,j)
    ans += c
    cnt += 1
print(ans)

### FIXED CODE ###

import sys
sys.setrecursionlimit(100000)
N=int(input())
xy=[list(map(int,input().split()))+[i] for i in range(N)]
xy.sort()
path = []

def get_par(n):
    if par[n] is None:return n
    par[n] = get_par(par[n])
    return par[n]

def same(i,j):
    return get_par(i) == get_par(j)

def unite(i,j):
    j = get_par(j)
    par[j] = get_par(i)
    return

for k in range(N-1):
    x,y,i = xy[k]
    x2,y2,j = xy[k+1]
    path.append((abs(x-x2),i,j))
xy.sort(key=lambda x:x[1])
for k in range(N-1):
    x,y,i = xy[k]
    x2,y2,j = xy[k+1]
    path.append((abs(y-y2),i,j))
path.sort(key = lambda x:x[0],reverse=True)
par = [None]*N
cnt = 0
ans = 0
while cnt < N-1:
    c,i,j = path.pop()
    if same(i,j):continue
    unite(i,j)
    ans += c
    cnt += 1
print(ans)
P=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101]
n=int(input())
A=[1]*n

for i in range(n):
	s=input()
	for j in range(10):
		A[i] *= P[ord(s[j])-97]

res=0
for i in range(n):
	for j in range(i+1,n):
		if A[i]==A[j]:
			res += 1
print(res)

### FIXED CODE ###

a, b = map(int,input().split())
x=a+b
y=a-b
z=a*b
list=[x,y,z]
print(max(list))
import sys
sys.setrecursionlimit(10**6)

def perm(n, k):
    return fact[n] * ifact[n-k] % mod

def dfs(v, p):
    global ans
    for nv in link[v]:
        if nv == p:
            continue
        dfs(nv, v)
    # p = -1の時は根である。根も含めて塗り分け方を考えるので、
    # n = K、c = 子の数+根の数で塗り分け方を求める
    # 見るのが子の時はその上の頂点とその親が塗られているので、
    # n = K-2、c = 子の数となる
    if p == -1:
        n = K
    else:
        n = K - 2
    if p == -1:
        k = len(link[v]) + 1
    else:
        k = len(link[v]) - 1

    ans *= perm(n, k)
    ans %= mod

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

mod = 10 ** 9 + 7
ans = 1

fact = [0] * (10**5+1)
fact[0] = 1
fact[1] = 1
for i in range(2, 10**5+1):
    fact[i] = fact[i-1] * i
    fact[i] %= mod
ifact = [0] * (10**5+1)
for i in range(10**5+1):
    ifact[i] = pow(fact[i], mod-2, mod)
    ifact[i] %= mod

dfs(0, -1)

print(ans % mod)


### FIXED CODE ###

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

print(min(N*A, B))
import itertools
import heapq
import sys
import functools
import operator
import numpy as np
input = sys.stdin.readline
#-------------
n,k = map(int,input().split())
a = list(map(int,input().split()))
#-------------
a.sort(reverse = True)
w = 10**9 + 7
ans = 1
if k%2 == 1:
  for i in range(k):
    ans *= a[i]
    print(ans % w)

else:
  if n%2 == 0:
    a_new = [a[2*i]*a[2*i+1] for i in range(n//2)]
    a_new.sort(reverse = True)
    print(a_new)
    for j in range(k//2):
      ans *= a_new[j]
      print(ans % w)
      
  else:
    a_plus = heapq.nlargest(k, a)
    a_minus = heapq.nsmallest(k, a)
    a_plus.sort(reverse = True)
    a_minus.sort()
    a_plus_new = [a_plus[2*i]*a_plus[2*i+1] for i in range(len(a_plus))]
    a_minus_new = [a_minus[2*i]*a_minus[2*i+1] for i in range(len(a_minus))]
    a_new = a_plus_new + a_minus_new
    a_new.sort(revserse = True)
    for j in range(k//2):
      ans *= a_new[j]
      print(ans % w)

### FIXED CODE ###

import sys
 
n, k = map(int, input().split())
a = [int(x) for x in input().split()]
mod = pow(10, 9)+7
zero = 0
plus = []
minus = []
for i in range(n):
  if a[i] == 0:
    zero += 1
  elif a[i] > 0:
    plus.append(a[i])
  else:
    minus.append(a[i])
 
P, M = len(plus), len(minus)
plus.sort(reverse=True)
minus.sort()
ans = 1
if n == k:
  for i in range(n):
    ans *= a[i]
    ans %= mod
elif P+M < k:
  ans = 0
elif P == 0:
  if zero and k%2:
    ans = 0
  else:
    if k%2:
      minus.reverse()
    for i in range(k):
      ans *= minus[i]
      ans %= mod
else:
  q = 0
  if k%2:
    ans *= plus[0]
    ans %= mod
    q = 1
  judge = []
  for i in range((len(plus)-q)//2):
    judge.append(plus[2*i+q]*plus[2*i+q+1])
  for i in range(len(minus)//2):
    judge.append(minus[2*i]*minus[2*i+1])
  judge.sort(reverse=True)
  for i in range(k//2):
    ans *= (judge[i]%mod)
    ans %= mod
 
print(ans)
s = list(input())

i = 0
res = 0
cnt = 0
while i != len(s) - 2:
    if s[i] == "A" and s[i + 1] == "A":
        cnt += 1
        i += 1
    elif s[i] == "A" and s[i + 1] == "B" and s[i + 2] == "C":
        res += cnt + 1
        s[i], s[i + 1], s[i + 2] = "B", "C", "A"
        cnt = 0
        i += 1
    else:
        cnt = 0
        i += 1
print(res)


### FIXED CODE ###

s = input()
s = s.replace('BC', 'D')

ans = a = 0
for i in s:
    if i == "A":
        a += 1
    elif i == "D":
        ans += a
    else:
        a = 0
print(ans)
def isprime(number):
    if number == 2 or 2 ** (number -1) % number == 1:
        return 1 
    else:
        return 0
def countPrime(number,count):
    if isprime(number)== 1:
        count +=1
    return count
        
n = int(input())
c = 0
for i in range(n):
    c = countPrime(i,c)
print (c)

### FIXED CODE ###

import sys
 
 
def is_prime(x):
    if x == 2:
        return True
    elif x < 2 or not x % 2:
        return False
 
    return pow(2, x - 1, x) == 1
 
 
def solve(_c_list):
    cnt = 0
    for ele in _c_list:
        if is_prime(ele):
            cnt += 1
    return cnt
 
 
if __name__ == '__main__':
    _input = sys.stdin.readlines()
    c_num = int(_input[0])
    c_list = list(map(int, _input[1:]))
    ans = solve(c_list)
    print(ans)
from math import gcd
N = 1000001
sieve = [-1] * (N + 1)
sieve[0] = sieve[1] = 0
for i in range(N + 1):
    if sieve[i] != -1:
        continue
    else:
        index = i * i
        while True:
            if index > N:
                break
            sieve[index] = i
            index += i

isCounted = [0] * 1000001
isPairwiseCoprime = True
M = int(input())
A = map(int,input().split())
for i in range(M):
    elem = M[i]
    if elem == 1:
        continue
    primeList = []
    while sieve[elem] != -1:
        primeList.append(sieve[elem])
        elem //= sieve[elem]
    primeList.append(elem)
    for elem1 in primeList:
        if isCounted[elem1] != 0:
            isPairwiseCoprime = False
            break
    if not isPairwiseCoprime:
        break
    for elem1 in primeList:
        isCounted[elem1] += 1
if isPairwiseCoprime:
    print("pairwise coprime")
else:
    curGcd = A[0]
    for elem in A:
        curGcd = gcd(elem,curGcd)
    if curGcd == 1:
        print("setwise coprime")
    else:
        print("not coprime")


### FIXED CODE ###

from math import gcd
N = 1000001
sieve = [-1] * (N + 1)
sieve[0] = sieve[1] = 0
for i in range(N + 1):
    if sieve[i] != -1:
        continue
    else:
        index = i * i
        while True:
            if index > N:
                break
            sieve[index] = i
            index += i

isCounted = [0] * 1000001
isPairwiseCoprime = True
M = int(input())
A = list(map(int,input().split()))
for i in range(M):
    elem = A[i]
    if elem == 1:
        continue
    primeList = []
    while sieve[elem] != -1:
        primeList.append(sieve[elem])
        elem //= sieve[elem]
    primeList.append(elem)
    for elem1 in primeList:
        if isCounted[elem1] != 0:
            isPairwiseCoprime = False
            break
    if not isPairwiseCoprime:
        break
    for elem1 in primeList:
        isCounted[elem1] += 1
if isPairwiseCoprime:
    print("pairwise coprime")
else:
    curGcd = A[0]
    for elem in A:
        curGcd = gcd(elem,curGcd)
    if curGcd == 1:
        print("setwise coprime")
    else:
        print("not coprime")
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 = []
    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])

### FIXED CODE ###

def main():
    N, L, T = map(int, input().split())
    collision = 0
    ants = []
    for i in range(N):
        x, w = map(int, input().split())
        if w == 1:
            collision += (x + T) // L
            a = (x + T) % L
        else:
            collision += (x - T) // L
            a = (x - T) % L
        ants.append(a)
 
    collision %= N
    ants.sort()
    ants = ants[collision:] + ants[:collision]
    for ant in ants:
        print(ant)
 
 
if __name__ == '__main__':
    main()
import sys
readline = sys.stdin.readline

# A + Bの組み合わせはせいぜい1～30のうち作れる数字のみなので全探索

A,B,C,D,E,F = map(int,readline().split())

if E == 0:
  print(min(A,B) * 100, 0)
  exit(0)

ans = [0,0]
maxrate = 0.0
for a in range(0,F,100 * A):
  for b in range(0,F,100 * B):
    if a == 0 and b == 0:
      continue
    if a + b > F:
      break
    water = a + b
    # waterに対して溶ける最大量は (a + b) * E
    limit = min(((a + b) / 100) * E, F - water)
    maxsugar = 0
    for c in range(0,limit + 1,C):
      for d in range(0,limit + 1,D):
        if c + d > limit:
          break
        if c + d > maxsugar:
          maxsugar = c + d
          rate = maxsugar / (water + maxsugar)
          if rate > maxrate:
            maxrate = rate
            ans = [water + maxsugar, maxsugar]
          
print(*ans)        

### FIXED CODE ###

A,B,C,D,E,F=map(int,input().split())
# 作れる水の量をDPで求める (MAXはF)
# 作れる砂糖の量をDPで求める　（MAXは、F*(E/(E+100)）
# 作れる水の量に対して二分探索で、最も多く入れられる砂糖の量を求める。

dpW=[False]*(F+1)
dpW[0]=True
for w in (A*100,B*100):
  for j in range(len(dpW)):
    if dpW[j] and j+w<len(dpW):
      dpW[j+w]=True
      
water=[]
for i in range(len(dpW)):
  if dpW[i] and i!=0:
    water.append(i)

maxsugar=int(F*(E/(E+100)))+1
dpS=[False]*(maxsugar+1)
dpS[0]=True
for s in (C,D):
  for j in range(len(dpS)):
    if dpS[j] and j+s<len(dpS):
      dpS[j+s]=True
sugar=[]
for i in range(len(dpS)):
  if dpS[i]:
    sugar.append(i)
    
ans=[0,0]
maxrate=0
for w in water:
  maxS=int(w*(E/100))
  if w+maxS>F:
    maxS=F-w
  # maxSを越えない最大の砂糖をsugarから探す
  ok=0
  ng=len(sugar)
  while abs(ok-ng)>1:
    mid=abs(ok+ng)//2
    if sugar[mid]<=maxS:
      ok=mid
    else:
      ng=mid
  if sugar[ok]/w>=maxrate:
    maxrate=sugar[ok]/w
    ans=[w+sugar[ok],sugar[ok]]
print(*ans)
import fractions

def main():
    N=int(input())
    num=list(map(int,input().split()))
    gcd=0
    gcd_list_front=[]
    gcd_list_back=[]
    gcd_list_front.append(num[0])
    gcd_list_back.append(num[-1])

    for  i in range(1,N-1):
        gcd_list_front.append(fractions.gcd(gcd_list_front[i-1],num[i]))
        gcd_list_back.append(fractions.gcd(gcd_list_back[i-1],num[-i-1]))
    gcd_list_back.reverse()

    gcd=max(gcd_list_back[0],gcd_list_front[-1])
    for i in range(0,N-2):
       temp_gcd=fractions.gcd(gcd_list_front[i],gcd_list_back[i+1])
       if temp_gcd>gcd:
           gcd=temp_gcd
    print(gcd)


if  __name__=="__main__":
    main()

### FIXED CODE ###

a,b,t=map(int,input().split())
x=0
num=0
c=a
for i in range(21):
    x=c
    c=a*(i+2)
    #print(x)
    if(x>t):
        break
    num+=b

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

if n == 1:
    a = int(input())
    for i in range(m):
        a //= 2
    print(a)
    exit()

a = sorted(list(map(int, input().split())))

for i in range(m):
    mx = max(a)
    a[index(mx)] //= 2
print(sum(a))

### FIXED CODE ###

n, k, q = map(int, input().split())
a = [int(input()) for _ in range(q)]

pt = [k-q for _ in range(n)]
for i in a:
    pt[i-1] += 1

for i in pt:
    if i > 0:
        print("Yes")
    else:
        print("No")
import math
pi=math.pi
r = int(input())
print('%f %f' % (2*pi*r, r*r*pi))


### FIXED CODE ###

import math
pi=math.pi
r = float(input())
print('%f %f' % (r*pi*r, 2*r*pi))
t=int(input())

li=list(map(int,input().split()))

count=0
while true:
  if li[0:t]%2==0:
  	for i in range(t):
    	li[i]=li[i]/2
    count+=1
	else:
  		break
print(count)

### FIXED CODE ###

t=int(input())

li=list(map(int,input().split()))

count=0
while True:
    x=[True if i%2==0 else False for i in li]
    if all(x):
        for i in range(t):
            li[i]=li[i]/2
        count+=1
    else:
        break
print(count)
from collections import deque

N = int(input())
A = deque()
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N == 1:
    print(str(A[0][0] + A[1][0]))
else:
    value_A = A[0][0] + A[0][1]
    value_B = A[0][0] + A[1][0]

    for i in range(2, N):
        value_C = value_A + A[1][i-1]
        value_A += A[0][i]
        value_B += A[1][i-1]

        if value_B < value_C:
            value_B = value_C

    print(str(max(value_A, value_B, value_C) + A[1][N-1]))

### FIXED CODE ###

N = int(input())

A = []
A.append(list(map(int, input().split())))
A.append(list(map(int, input().split())))

if N > 1:
    up = A[0][1]
    down = A[1][0]

    for i in range(1, N-1):
        up_ = up + A[1][i]
        down += A[1][i]
        up += A[0][i+1]

        down = max(down, up_)

    print(max(up, down)+A[0][0]+A[1][N-1])
else:
    print(A[0][0]+A[1][0])