Harryxun/stf_run huggingface dataset:
N = int(input())
 
mi = 10**10
 
for a in range(int(math.sqrt(N)), N+1, 1):
  N % a == 0:
    b = N//a
    if mi > a+b-2:
      mi = a+b-2
print(mi)

### FIXED CODE ###

import math

N = int(input())
 
mi = 10**100

for a in range(1, int(math.sqrt(N))+1, 1):
  if N % a == 0:  
    b = N//a
    if mi > a+b-2:
      mi = a+b -2
print(mi)
n=int(input())
p=[list(map(int,input().split()))]
if n==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(1,101):
    for j in range(1,101):
      k=1
      l=p[0][2]+abs(i-p[0][1])+abs(j-p[0][1])
      for x,y,h in p:
        m=abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])

### FIXED CODE ###

n=int(input())
p=[list(map(int,input().split()))for i in range(n)]
d=[]
for i in range(n):
  if p[i][2]==0:
    d.append(i)
d.sort(reverse=1)
for i in d:
  del p[i]
if len(p)==1:
  print(p[0][0],p[0][1],p[0][2])
else:
  for i in range(0,101):
    for j in range(0,101):
      k=1
      l=p[0][2]+abs(i-p[0][0])+abs(j-p[0][1])
      for x,y,h in p:
        if h==0:
          continue
        m=h+abs(i-x)+abs(j-y)
        if l!=m:
          k=0
      if k:
        ans=[i,j,l]
  print(ans[0],ans[1],ans[2])
n = int(raw_input())
s = [[] for i in range(n)]
flag = 0
for i in range(n):
    s[i] = raw_input()
for i in range(n,1,-1):
    for j in range(n-i+1):
        for k in range(n-i+1):
            out = ""
            for l in range(i):
                for m in range(i):
                    out += s[j+l][k+m]
            if out = "."*i:
                print i
                flag = 1
            if flag == 1: break
        if flag == 1: break
    if flag == 1: break

### FIXED CODE ###

while True:
    n = int(raw_input())
    if n == 0: break
    field = [raw_input() for i in range(n)]
    large = [[0]*(n + 1) for i in range(n + 1)]
    for i in range(n):
        for j in range(n):
            if field[i][j] == '.':
                large[i][j] = min(large[i][j - 1], large[i - 1][j], large[i - 1][j - 1]) + 1
    print max(map(max, large))
N = int(input())
A = list(map(int,input().split()))

debug = True

while True:
    changed = False
    i = 1
    while i < N - 1:
        if (A[i] > 0) and (A[i - 1] < 0) and (A[i + 1] < 0):
            A[i] = A[i] * -1
            A[i - 1] = A[i - 1] * -1
            changed = True
            if debug: print("change 0:" + str(A))
            i = i + 3
        else:
            i = i + 1
    for i in range(N - 1):
        if (A[i] < 0) and (A[i + 1] < 0):
            A[i] = A[i] * -1
            A[i + 1] = A[i + 1] * -1
            changed = True
            if debug: print("change 1:" + str(A))
    for i in range(N - 1):
        if (A[i] < 0):
            val = A[i] * -1
            if (i > 0):
                if A[i + 1] < A[i - 1]:
                    if val > A[i + 1]:
                        A[i] = A[i] * -1
                        A[i + 1] = A[i + 1] * -1
                        changed = True
                        if debug: print("change 2:" + str(A))
                else:
                    if val > A[i - 1]:
                        A[i] = A[i] * -1
                        A[i - 1] = A[i - 1] * -1
                        changed = True
                        if debug: print("change 3:" + str(A))
            else:
                if val > A[i + 1]:
                    A[i] = A[i] * -1
                    A[i + 1] = A[i + 1] * -1
                    changed = True
                    if debug: print("change 4:" + str(A))
    if (not changed):
        break


print(sum(A))



### FIXED CODE ###

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

minus_cnt = 0
abs_sum = 0
min_abs_val = 1000000000
for i in range(N):
    abs_val = abs(A[i])
    abs_sum = abs_sum + abs_val
    if abs_val < min_abs_val:
        min_abs_val = abs_val
    if A[i] < 0:
        minus_cnt = minus_cnt + 1

B_max_sum = 0
if (minus_cnt % 2 == 0) or (min_abs_val == 0):
    B_max_sum = abs_sum
else:
    B_max_sum = abs_sum - min_abs_val * 2

print(B_max_sum)
import math

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

A = ABCD[0]
B = ABCD[1]
C = ABCD[2]
D = ABCD[3]


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

AB = B-A
count = 0

firstC = int(A/C)
if A%C == 0:
    firstC -= 1
firstD = int(A/D)

if A%D == 0:
    firstD -= 1

firstCD = int(A/lcm(C,D))
if A%lcm(C,D) ==0:
    firstCD -= 1

endC = int(B/C)
endD = int(B/D)
endCD = int(B/lcm(C,D))

thereC = endC - firstC
thereD = endD - firstD
thereCD = endCD - firstCD

NoP = thereC+thereD - thereCD
#
# print(thereC)
# print(thereD)
# print(thereCD)
# print(NoP)

print(B-A+1-NoP)









### FIXED CODE ###

import fractions

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

A = ABCD[0]
B = ABCD[1]
C = ABCD[2]
D = ABCD[3]


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


def floor(a, b):
  # return int((a - a%b)/b)
  return a//b
def gcd(a, b):
  while b != 0:
      a, b = b, a % b
  return a
def lcm(a, b):
  return floor((a * b), gcd(a, b))

firstC = floor((A-1),C)
firstD = floor((A-1),D)
firstCD = floor((A-1),lcm(C,D))

# if A%lcm(C,D) ==0 and firstCD > 0:
#     firstCD -= 1

endC = floor(B,C)
endD = floor(B,D)
endCD = floor(B,lcm(C,D))

End = B-endC-firstD + endCD
First = (A-1) - firstC - firstD + firstCD



thereC = endC - firstC
thereD = endD - firstD
thereCD = endCD - firstCD

NoP = thereC+thereD - thereCD

# print(thereC)
# print(thereD)
# print(thereCD)
# print(NoP)
print((B-A+1)-NoP)
# print(End-First)
n = int(input())
a = *map(int, input().split()),
for i in range(1, n+1):
    print(a.index(i)+1, end = ' ')


### FIXED CODE ###

n = int(input())
a = tuple(map(int, input().split()))
b = dict((j,i + 1) for i, j in enumerate(a))
for i in sorted(a):
    print(b[i], end=' ')
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = 0
i = 0
while(True):
    if d <= x:
        d += l[i]
        i += 1
    else:
        break
print(i)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
#print(len(l))
a = len(l)
d = 0
i = 0
while(i<=a):
    if d <= x:
        if i == a:
            i += 1
            break
        d += l[i]
        i += 1
    else:
        break
print(i)
n,m = map(int,input().split())
A = [int(input()) for _ in range(m)]
mod = 1000000007
dp = [0]*(n+1)
dp[0],dp[1] = 1,1
for i in range(2,n+1):
    dp[i] = (dp[i-1] + dp[i-2])
    if i in a:dp[i] = 0
print(dp[n])

### FIXED CODE ###

n,m=map(int,input().split())
a=set([int(input()) for i in range(m)])
dp=[0]*(n+1)
dp[0]=1
for i in range(1,n+1):
    dp[i]=(dp[i-1]+dp[i-2])%(10**9+7)
    if i in a:dp[i]=0
print(dp[n])
import sys
import bisect
import math
import numpy as np
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from operator import itemgetter

n,s=map(int,readline().split())
a=list(map(int,readline().split()))
mod=998244353
dp=[[0 for j in range(s+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(s+1):
        dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod
        if j+a[i]<=s:
            dp[i+1][j+a[i]]+=dp[i][j]
            dp[i+1][j+a[i]]%=mod
print(dp[n][s])

### FIXED CODE ###

import sys
import bisect
import math
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
from operator import itemgetter

n,s=map(int,readline().split())
a=list(map(int,readline().split()))
mod=998244353
dp=[[0 for j in range(s+1)] for i in range(n+1)]
dp[0][0]=1
for i in range(n):
    for j in range(s+1):
        dp[i+1][j]+=2*dp[i][j]
        dp[i+1][j]%=mod
        if j+a[i]<=s:
            dp[i+1][j+a[i]]+=dp[i][j]
            dp[i+1][j+a[i]]%=mod
print(dp[n][s])
from collections import Counter
import sys
def muri():
    print(-1)
    sys.exit()
N = int(input())
#D = [int(sys.stdin.readline()) for _ in range(N)]
D = list(map(int, input().split()))
Didx = list(range(1, N+1))
Didx.sort(key = lambda x: -D[x-1])
H = {d: i for i, d in enumerate(D, 1)}
H = Counter(H)
D = [0] + D
K = [1]*(N+1)
Ans = []
for vn in Didx[:-1]:
    p = H[D[vn] - (N - 2*K[vn])]
    if not p:
        muri()
    Ans.append((vn, p))
    K[p] += K[vn]
s = set()

Edge = [[] for _ in range(N+1)]
for a in Ans:
    x, y = a
    Edge[x].append(y)
    Edge[y].append(x)

dist = [10**9+7]*(N+1)
dist[0] = 0
dist[1] = 0
stack = [1]
visited = set([1])
while stack:
    vn = stack.pop()
    for vf in Edge[vn]:
        if vf not in visited:
            visited.add(vf)
            dist[vf] = 1 + dist[vn]
            stack.append(vf)
if D[1] != sum(dist[1:]):
    muri()

for a in Ans:
    print(*a)

### FIXED CODE ###

from collections import Counter
import sys
def muri():
    print(-1)
    sys.exit()
N = int(input())
D = [int(sys.stdin.readline()) for _ in range(N)]
#D = list(map(int, input().split()))
Didx = list(range(1, N+1))
Didx.sort(key = lambda x: -D[x-1])
H = {d: i for i, d in enumerate(D, 1)}
H = Counter(H)
D = [0] + D
K = [1]*(N+1)
Ans = []
for vn in Didx[:-1]:
    p = H[D[vn] - (N - 2*K[vn])]
    if not p:
        muri()
    Ans.append((vn, p))
    K[p] += K[vn]
s = set()

Edge = [[] for _ in range(N+1)]
for a in Ans:
    x, y = a
    Edge[x].append(y)
    Edge[y].append(x)

dist = [10**9+7]*(N+1)
dist[0] = 0
dist[1] = 0
stack = [1]
visited = set([1])
while stack:
    vn = stack.pop()
    for vf in Edge[vn]:
        if vf not in visited:
            visited.add(vf)
            dist[vf] = 1 + dist[vn]
            stack.append(vf)
if D[1] != sum(dist[1:]):
    muri()

for a in Ans:
    print(*a)
N=int(input()) 
a=[int(input()) for i in range(N)]
b=sorted(a)
n=0
while True:
    if n==a.index(max(a)):
        print(b[-2])
    else:
        print(b[-1])
    n+=1
    if n==N:
        break

### FIXED CODE ###

a=int(input())
print(3*(a**2))
A, P = map(int, input.split(" "))
print((3 * A + P) // 2)


### FIXED CODE ###

A, P = map(int, input().split(" "))
print((3 * A + P) // 2)
TH,TS,AH,AS = map(int,input().split())
while Ture:
  AH -= TS
  if AH <= 0:
    print('Yes')
    break
  else:
    TH -= AS
    if TH <= 0:
      print('No')
      break

### FIXED CODE ###

TH,TS,AH,AS = map(int,input().split())
while True:
  AH -= TS
  if AH <= 0:
    print('Yes')
    break
  else:
    TH -= AS
    if TH <= 0:
      print('No')
      break
N = int(input())
X = input().strip()
C = X.count("1")
D = int(X, 2)

p = [0]*(2*10**5+1)
for i in range(1, len(p)):
    n = i
    while True:
        b = bin(n).count("1")
        if b <= 0:
            break
        n = n % b
        p[i] += 1

for i in range(1, N+1):
    d = D
    c = C
    if X[i-1] == "1":
        c -= 1
        d -= 1 << (N-i)
    else:
        c += 1
        d += 1 << (N-i)

    d = d % c
    print(p[d]+1)


### FIXED CODE ###

N = int(input())
X = input().strip()
C = X.count("1")
D = int(X, 2)
Mm, Mp = 0, D % (C+1)
if C > 1:
    Mm = D % (C-1)

p = [0]*(2*10**5+2)
for i in range(1, len(p)):
    n = i
    while True:
        b = bin(n).count("1")
        if b <= 0:
            break
        p[i] += 1
        n = n % b

for i in range(1, N+1):
    c = C
    if X[i-1] == "1":
        c -= 1
        if c == 0:
            print(0)
            continue
        m = Mm
        d = pow(2, N-i, c)
        d = (m-d+c) % c
    else:
        c += 1
        m = Mp
        d = pow(2, N-i, c)
        d = (m+d) % c

    print(p[d]+1)
n = int(input())
a = list(map(int,input().split()))
for i in range(a):
    if i%2==0:
        if i%3 !=0 and i%5 !=0:
            print('DENIED')
            exit()
print('APPROVED')

        
        
                

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
for i in a:
    if i%2==0:
        if i%3 !=0 and i%5 !=0:
            print('DENIED')
            exit()
print('APPROVED')
n = int(input())
s = input()
if n%2==0:
  if s[:n]=s[n:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')

### FIXED CODE ###

n = int(input())
s = input()
m = int(n/2)
if n%2==0:
  if s[:m]==s[m:]:
    print('Yes')
  else:
    print('No')
else:
  print('No')
N = int(input())
A = list(map(int,input().split()))
L = [0]*100000
s = sum(A)
for a in A:
    L[a] += 1 #数字のカウント
Q = int(input())
for i in range(Q):
    B,C = map(int,input().split())
    s += L[B]*(C-B) #合計値の変化
    L[C] += L[B] 
    L[B] = 0 #Bの値の数だけCに移す
    print(s)


### FIXED CODE ###

N = int(input())
A = list(map(int,input().split()))
L = [0]*100001
s = sum(A)
for a in A:
    L[a] += 1 #数字のカウント
Q = int(input())
for i in range(Q):
    B,C = map(int,input().split())
    s += L[B]*(C-B) #合計値の変化
    L[C] += L[B] 
    L[B] = 0 #Bの値の数だけCに移す
    print(s)
for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    if (b-d)/(a-c) == (f-h)/(e-g):
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

for _ in range(int(input())):
    a,b,c,d,e,f,g,h=map(float, input().split())
    
    if abs((c-a)*(h-f) - (g-e)*(d-b)) < 1e-10:
        print("YES")
    else:
        print("NO")
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)-1
for i in range(2,r):
    if a%i==0 & b%i==0:
        tar.append(i)
tar.sort(reverse=True)
print(tar[k-1])

### FIXED CODE ###

a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r+1):
    if a%i==0 and b%i==0:
        tar.append(i)
print(tar[-k])
a,b,k=map(int,input().split())
 
for a,b in range(k):
	if a >=  1:
    	a -= 1
  
	elif a < 1 and b >= 1:
		b -= 1
	else:
      	break
        
print (a,b,end=" ")

### FIXED CODE ###

s = input().split()
print(s[1] + s[0])
n = int(input())
l = list(map(int,input()))
import bisect
l.sort()
ans = 0
for i in range(n-2):
    for j in range(i+1,n-1):
        x = bisect.bisect_left(l[j+1:],l[i]+l[j])
        ans += x
print(ans)

### FIXED CODE ###

n = int(input())
l = list(map(int, input().split()))
l.sort()
 
from bisect import bisect_left
ans = 0
for i in range(n):
  for j in range(i+1, n):
    t = l[i]+l[j]
    idx = bisect_left(l, t)
    ans += max(0, idx-j-1)
print(ans)
n = int(input())

if n < 1200 :
    print(ABC)
elif n < 2800 :
    print(ARC)
else :
    print(AGC)
    

### FIXED CODE ###

n = int(input())

if 0 <= n and n < 1200 :
    print("ABC")
elif n < 2800 :
    print("ARC")
else :
    print("AGC")
import math
# import itertools
# import statistics
# import numpy as np
#n = int(input())
n, q = list(map(int, input().split()))
#b = list(map(int, input().split()))
s = input()
lr = []
for i in range(q):
    x, y = list(map(int, input().split()))
    lr.append([x, y])

ac_count = [0]*int(len(s))
point = 0
for i in range(len(s)):
    if s[i] == "A" and s[i+1] == "C":
        ac_count[i] += point+0.5
        point += 0.5
        ac_count[i+1] += point+0.5
        point += 0.5
    else:
        ac_count[i] = point

for i in range(q):
    print(math.floor(ac_count[lr[i][1]-1])-math.floor(ac_count[lr[i][0]-1]))


### FIXED CODE ###

import math
# import itertools
# import statistics
# import numpy as np
#n = int(input())
n, q = list(map(int, input().split()))
#b = list(map(int, input().split()))
s = input()
lr = []
for i in range(q):
    x, y = list(map(int, input().split()))
    lr.append([x, y])

ac_count = [0]*int(len(s))
point = 0
for i in range(len(s)-1):
    if s[i] == "A" and s[i+1] == "C":
        ac_count[i] += point+0.5
        point += 0.5
        ac_count[i+1] += point+0.5
        point += 0.5
    else:
        ac_count[i] = point
ac_count[-1] = point
for i in range(q):
    print(math.floor(ac_count[lr[i][1]-1])-math.floor(ac_count[lr[i][0]-1]))
print(int(r**2))


### FIXED CODE ###

r=int(input())
print(int(r**2))
l = input().split()
a = int(l[0])
b = int(l[1])

def gcd(ac, bc):
  x = max(ac, bc)
  y = min(ac, bc)

  while x%y != 0:
    z = x%y
    x = y
    y = z
  else:
    return z

print(a * b // gcd(a, b))

### FIXED CODE ###

import fractions
l = input().split()
a = int(l[0])
b = int(l[1])

print(a * b // fractions.gcd(a, b))
if __name__ == "__main__":
    _ = input()
    nums = map(int, input().split(" "))
    count = 0
    for n in nums:
        while n%2 == 0:
            n /= 2
            count += 1

    print(count)


### FIXED CODE ###

if __name__ == "__main__":
    a, b = map(int, input().split(" "))
 
    if a > 8 or b > 8:
        print(":(")
    else:
        print("Yay!")
while True:
    x=input().split()
    a=int(x[0])
    op=x[1]
    b=int(x[2])
    if op =="+":
      print(a+b)
    elif op=="-":
       print(a-b)
    elif op=="*":
       print(a*b)
    eilf op=="/":
       print(a/b)
    else:
         break



### FIXED CODE ###

while True:
    x=input().split(" ")
    a=int(x[0])
    op=x[1]
    b=int(x[2])
    if op == "+":
        print(a + b)
    elif op == "-":
        print(a - b)
    elif op == "*":
        print(a * b)
    elif op == "/":
        print(a // b)
    elif op == "?":
        break
s = input()
print('Yes' if len(set(s[:3])) == 1 or len(set[1:]) == 1 else 'No')

### FIXED CODE ###

s = input()
print('Yes' if len(set(s[:3])) == 1 or len(set(s[1:])) == 1 else 'No')
H, W = (int(i) for i in input().split())
t = []
t.append(['.']*(H+2))

for j in range(H):
	tmp = input()
	tmp = '.' + tmp + '.'
	t.append(list(tmp))

t.append(['.']*(H+2))

def CheckBlock(i,k):
	if t[i][k-1] == '#': #check up
		return 0
	elif t[i-1][k] == '#': #check left
		return 1
	elif t[i+1][k] == '#': #check right
		return 2
	elif t[i][k+1] == '#': #check down
		return 3
	else:
		return 4

for i in range(1,W+1):
	for k in range(1,H+1):
		if t[i][k] == '#':
			marker = CheckBlock(i,k)
			#ChangeBlock(i,k,marker)
			if marker == 4:
				print('No')
				quit()
print('Yes')

### FIXED CODE ###

H, W = (int(i) for i in input().split())
t = []
t.append(['.']*(H+2))

for j in range(H):
	tmp = input()
	tmp = '.' + tmp + '.'
	t.append(list(tmp))

t.append(['.']*(H+2))

def CheckBlock(i,k):
	if t[i][k-1] == '#': #check up
		return 0
	elif t[i-1][k] == '#': #check left
		return 1
	elif t[i+1][k] == '#': #check right
		return 2
	elif t[i][k+1] == '#': #check down
		return 3
	else:
		return 4

for k in range(1,W+1):
	for i in range(1,H+1):
		if t[i][k] == '#':
			marker = CheckBlock(i,k)
			if marker == 4:
				print('No')
				quit()
print('Yes')
A,P=map(int,input().split())↲
d=0
c=A*3
if c>1:
  d=(c+P)//2
elif c==0 and P>1:
  d=P//2
print(d)↲

### FIXED CODE ###

a, p = map(int, input().split())
#print (int((a*3 + p) / 2))
#a,p=map(int,input().split())↲
print(int((a*3+p)/2))
def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**5+5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

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

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

    return arr


n,m=map(int,input().split())
A=factorization(m)
if m==1:
  print(1)
else:
  ans=1
  for i in range(len(A)):
    ans=ans*cmb(n+A[i][1]-1,A[i][1],mod)
print(ans%(10**9+7))

### FIXED CODE ###

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9+7 #出力の制限
N = 2*10**5+5
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

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

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

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

    return arr


n,m=map(int,input().split())
A=factorization(m)
ans=1
if m==1:
  print(ans)
else:
  for i in range(len(A)):
    ans=ans*cmb(n+A[i][1]-1,A[i][1],mod)
  print(ans%(10**9+7))
N = int(input())
import math
l = [int(x) for x in input().split()]
tobi = [0]*(math.ceil(N/2))
tobi[0] = l[0]
for i in range(1,math.ceil(N/2)):
    tobi[i] = tobi[i-1] + l[i*2]
def motomeru(x,y):
    if y == 0 or x == 0 or x == 1:
        return 0
    elif x % 2 == 0:
        return max(motomeru(x-2,y-1)+l[x-1],tobi[math.floor((x-1)/2)])
    else:
        return max(motomeru(x-2,y-1)+l[x-1],motomeru(x-1,y))
print(motomeru(N,N//2))

### FIXED CODE ###

import sys
sys.setrecursionlimit(2000000000)
N = int(input())
import math
l = [int(x) for x in input().split()]
tobi = [0]*(math.ceil(N/2))
tobi[0] = l[0]
for i in range(1,math.ceil(N/2)):
    tobi[i] = tobi[i-1] + l[i*2]
from functools import lru_cache
@lru_cache(maxsize=1000000000)
def motomeru(x,y):
    if y == 0 or x == 0 or x == 1:
        return 0
    elif x % 2 == 0:
        return max(motomeru(x-2,y-1)+l[x-1],tobi[math.floor((x-1)/2)])
    else:
        return max(motomeru(x-2,y-1)+l[x-1],motomeru(x-1,y))
print(motomeru(N,N//2))
x,t = map(int, input().split())
print(max(x-t,0)

### FIXED CODE ###

x,t = map(int, input().split())
print(max(x-t,0))
s=input()
S=[]
for i in range(len(s)):
  S.append(s[i])
print("yes" if len(setS))==len(s) else "No")

### FIXED CODE ###

s=input()
S=[]
for i in range(len(s)):
  S.append(s[i])
print("yes" if len(set(S))==len(s) else "no")
while True:
	t = input().split()
	a = int(t[0])
	b = t[1]
	c = int(t[2])
	d = 0
	if (a == 0 and b == "?" and c == 0):
		break
	if (b == "+"):
		d = a + c
	if (b == "-"):
		d = a - c
	if (b == "*"):
		d = a * c
	if (b == "/"):
		d = int(a / c)
	print(str(d))
	

### FIXED CODE ###

while True:
    Input = input().split()
    a = int(Input[0])
    op = Input[1]
    b = int(Input[2])
    
    if op == '?':
        break
    
    if op == '+':
        print(a+b)
    elif op == '-':
        print(a-b)
    elif op == '*':
        print(a*b)
    else:
        print(a//b)
s = [len(x) for x in input().split('T')]
x, y = map(int, input().split())
len_s = len(s)
sx = [s[i] for i in range(len_s) if i%2 == 0]
sy = [s[i] for i in range(len_s) if i%2 == 1]

x -= sx[0]
sx = sx[1:]

def is_reachable(p, s):
    origin = 8
    n = len(s)
    reachable = [[False for _ in range(origin*2+1)] for i in range(n+1)]
    reachable[0][origin] = True

    for i in range(n):
        for j in range(origin*2+1):
            if not reachable[i][j] :
                continue
            if j-s[i] >= 0:
                reachable[i+1][j-s[i]] = True
            if j+s[i] <= origin*2:
                reachable[i+1][j+s[i]] = True
    return reachable[n][p+origin] or reachable[n][-p+origin]


if is_reachable(x, sx) and is_reachable(y, sy):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

s = [len(x) for x in input().split('T')]
x, y = map(int, input().split())
len_s = len(s)
sx = [s[i] for i in range(len_s) if i % 2 == 0]
sy = [s[i] for i in range(len_s) if i % 2 == 1]

x -= sx[0]
sx = sx[1:]



def is_reachable(p, s):
    origin = 8000
    if origin+p < 0:
        return False
        
    n = len(s)
    reachable = [set() for i in range(n + 1)]
    reachable[0].add(origin)

    for i in range(n):
        for j in list(reachable[i]):
            if j - s[i] >= 0:
                reachable[i + 1].add(j - s[i])
            if j + s[i] <= origin * 2:
                reachable[i+1].add(j + s[i])
    return (origin+p) in reachable[n] or (origin-p) in reachable[n]


if is_reachable(x, sx) and is_reachable(y, sy):
    print('Yes')
else:
    print('No')