Harryxun/stf_run huggingface dataset:
s = [0] * 200000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)

### FIXED CODE ###

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
s = [0] * 1000000
for i in range(N):
    s[i+1] = s[i] + A[i]

max_s = 0
for i in range(N):
    if max_s < s[i+K] - s[i]:
        max_s = s[i+K] - s[i]


print((max_s+K) / 2)
S = input()

if len(S) == 2:
	print (S)
else:
	new_str_list = list(reversed(S))
	#print(new_str_list)
    print (new_str_list.join(''))

### FIXED CODE ###

S = str(input()).rstrip()

if len(S) == 2:
  print (S)
else:
  print (S[::-1])
K, X = map(int, input())

if 500 * X >= X:
    print('Yes')
else:
    print('No')


### FIXED CODE ###

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

if 500 * K >= X:
    print('Yes')
else:
    print('No')
import sys
h, w, k = map(int, input().split())
grid = [[1 if v == '1' else 0 for v in input()] for _ in range(h)]

ass(False)
def ass(v):
    if not v:
        print(-1)
        sys.exit(0)

ass(h > 0 and w > 0 and k > 0)
for row in grid:
    ass(len(row) == w)


def count_ones(i):
    cnt = 0
    while i:
        if i & 1:
            cnt += 1
        i >>= 1
    return cnt

ans = h + w

for state in range(1 << h):
    j = 0
    vcnt = 0
    counters = [0] * (h + 1)
    is_ok = True
    while j < w:
        hi = 0
        i = 0
        local_counters = [0] * (h + 1)
        ass(len(counters) == len(local_counters))
        while i < h:
            if (1 << i) & state:
                hi = i
            # print(hi, i, j)
            # print(grid[i])
            ass(len(local_counters) > hi)
            ass(i < h and j < w)
            local_counters[hi] += grid[i][j]
            i += 1
        for i, v in enumerate(local_counters):
            if v > k:
                is_ok = False
                break
            counters[i] += local_counters[i]
        if not is_ok:
            break
        if max(counters) > k:
            counters = local_counters.copy()
            vcnt += 1

        j += 1


    if is_ok and ans > count_ones(state) + vcnt:
        ans = count_ones(state) + vcnt
print(ans)



### FIXED CODE ###

import sys
def ass(v):
    if not v:
        print(-1)
        sys.exit(0)

h, w, k = map(int, input().split())
grid = [[1 if v == '1' else 0 for v in input()] for _ in range(h)]


ass(h > 0 and w > 0 and k > 0)
for row in grid:
    ass(len(row) == w)


def count_ones(i):
    cnt = 0
    while i:
        if i & 1:
            cnt += 1
        i >>= 1
    return cnt

ans = h + w

for state in range(1 << h):
    j = 0
    vcnt = 0
    counters = [0] * (h + 1)
    is_ok = True
    while j < w:
        hi = 0
        i = 0
        local_counters = [0] * (h + 1)
        ass(len(counters) == len(local_counters))
        while i < h:
            if (1 << i) & state:
                hi = i
            # print(hi, i, j)
            # print(grid[i])
            ass(len(local_counters) > hi)
            ass(i < h and j < w)
            ass(len(grid) > i)
            ass(len(grid[i]) > j)
            local_counters[hi] += grid[i][j]
            i += 1
        for i, v in enumerate(local_counters):
            if v > k:
                is_ok = False
                break
            counters[i] += local_counters[i]
        if not is_ok:
            break
        # ass(len(counters))
        # ass(k)
        if max(counters) > k:
            counters = local_counters[:]
            vcnt += 1

        j += 1


    if is_ok and ans > count_ones(state) + vcnt:
        ans = count_ones(state) + vcnt
print(ans)
s, t = input().split()
a, b = list(map(int, input, split()))
u = input()
if u == s:
    print("{} {}".format(a-1, b))
else:
    print("{} {}".format(a, b-1))


### FIXED CODE ###

s, t = input().split()
a, b = list(map(int, input().split()))
u = input()
if u == s:
    print("{} {}".format(a-1, b))
else:
    print("{} {}".format(a, b-1))
S=str(input())
ListNum=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<(len(S)-2):
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    ListNum.append(Num)

for j in range(0,len(ListNum)-1,1):
  NUm=int(ListNum[i])-753
  NUM=int(NUm**2)
  ListNUM.append(NUM)

mini=min(ListNUM)
ans=ListNUM.index(mini)
print(ListNum[ans])


### FIXED CODE ###

S=str(input())
ListNum=[]
ListNUm=[]
ListNUM=[]
for i in range(0,len(S),1):
  if i<len(S)-2:
    Num=100*int(S[i])+10*int(S[i+1])+int(S[i+2])
    NUm=Num-753
    NUM=NUm**2
    ListNum.append(Num)
    ListNUm.append(NUm)
    ListNUM.append(NUM)
posi=ListNUM.index(min(ListNUM))

if ListNUm[posi]<0:
  ListNUm[posi]=ListNUm[posi]*(-1)
print(ListNUm[posi])
import bisect


def main():
  n = int(input())
  a = [int(input()) for _ in range(n)]

  tail = []
  len_tail = 0
  for ai in a:
    print(tail, ai)
    idx = bisect.bisect_left(tail, -ai, lo=0, hi=len_tail) 
    if idx == len_tail:
      tail.append(-ai)
      len_tail += 1
    else:
      tail[idx] = - ai

  print(len_tail )


if __name__ == "__main__":
  main()

### FIXED CODE ###


import bisect


def main():
  n = int(input())
  a = [int(input()) for _ in range(n)]

  tail = []
  len_tail = 0
  for ai in a:
    idx = bisect.bisect_right(tail, -ai, lo=0, hi=len_tail) 
    if idx == len_tail:
      tail.append(-ai)
      len_tail += 1
    else:
      tail[idx] = - ai

  print(len_tail )


if __name__ == "__main__":
  main()
x=input()
print(x**3)


### FIXED CODE ###

x=int(input())
result = x**3
print(result)
a = int(input())
ar = []
l = 50
t = ''
for i in range(a):
    j = input()
    ar.append(j)
    if len(j) < l:
        l = len(j)
        t = j
ar.remove(t)
br = []
for i in range(l):
    count = 0
    for r in ar:
        if t[i] in r:
            count += 1
    if count == len(ar):
        br.append(t[i])
br.sort()
print("".join(br))

### FIXED CODE ###

a = int(input())
ar = []
for i in range(a):
    l = input()
    ar.append(l)
br = set(list(ar[0]))
dr = []
for r in br:
    cr =[]
    count = 0
    for rr in ar:
        if rr.count(r) > 0:
            cr.append(rr.count(r))
            count += 1
        if count == a:
            for i in range(min(cr)):
                dr.append(r)
print("".join(sorted(dr)))
a=input()
b=input()

print(a*b)

### FIXED CODE ###

a,b = map(int,input(). split ())
print(a*b)
N = int(input()
H = list(map(int, input().split()))

dp = [0] * N

for i in range(1, N):
	if i == 1:
		dp[i] = dp[0] + abs(H[i] - H[0])
	else:
		dp[i] = min(dp[i-2] + abs(H[i] - H[i-2]), dp[i-1] + abs(H[i] - H[i-1]))

return dp[-1]


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, h: "List[int]"):
    dp = [0] * N
    dp[0] = 0
    dp[1] = dp[0] + abs(h[1] - h[0])
    for i in range(2, N):
        dp[i] = min(
            dp[i-1] + abs(h[i] - h[i-1]),
            dp[i-2] + abs(h[i] - h[i-2]),
        )

    print(dp[-1])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, h)


if __name__ == '__main__':
    main()
n = int(raw_input())
minv =  R[0]
maxv = (-1)*10**9

  for j in range(2, n-1):
    if minv >= R[j]:
       minv = R[j]
    if maxv <= R[i+1] - minv:
       maxv = R[i+1] - minv

### FIXED CODE ###

n = int(raw_input())
minv = int(raw_input())
maxv = -1*10**9  

for j in range(n-1):
    a = int(raw_input())
    b = a- minv
    if maxv < b:
       maxv = b 
    if minv > a:
       minv = a

print maxv
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
k=0
i=0
cnt=0
lis=[]
while i<=n-2 or cnt<2:
  if a[i]==a[i+1] and a[i]!=k:
    lis.append(a[i])
    k=a[i]
    cnt+=1
  i+=1
if len(lis)>=2:
  print(lis[0]*lis[1])
else:
  print(0)

### FIXED CODE ###

n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
lis=[]
cnt=0
for i in range(n-1):
  if a[i+1]==a[i]:
    cnt+=1
  else:
    if cnt>=1:
      lis.append([a[i],cnt])
    cnt=0
if cnt>=1:
  lis.append([a[n-1],cnt])
lis.sort(reverse=True)
if len(lis)>=2:
  if lis[0][1]>=3:
    print(lis[0][0]**2)
  else:
    print(lis[0][0]*lis[1][0])
elif len(lis)==1:
  if lis[0][1]>=3:
    print(lis[0][0]**2)
  else:
    print(0)
else:
  print(0)
n = int(input())

if 'hi' in n:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

n = raw_input()

length = len(n)
if length % 2 == 0:
  if n.count('hi')==length/2:
    print("Yes")
  else:
    print("No")
else:
  print("No")
import math

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

gcd_l = [0]
gcd_r = [0]

for i in range(N):
    gcd_l.append(math.gcd(gcd_l[i], A[i]))
    gcd_r.append(math.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(math.gcd(gcd_l[i], gcd_r[i+1]))
print(max(ans))

### FIXED CODE ###

N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))
#print(N, V, C)
ans = 0
for i in range(N):
    if V[i] - C[i] > 0:
        ans += V[i] - C[i]
print(ans)
D,N = map(int,input().split())
ans = []
for i in range(10000000):
  if i%(100**D) == 0:
    ans.append(i)
    if len(ans) == N:
print(ans[N])


### FIXED CODE ###

import sys
d,n = map(int,input().split())
num = 100**d
if n == 100:
  print(101*num)
  sys.exit()
if d == 0:
  print(n)
else:
  print((100**d)*n)
N = input()
if N in 7:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

N = input()

count = N.count('7')
if count >= 1:
  print('Yes')
else:
  print('No')
N, K   = map(int, input().split())
L = list(map(int, input().split()))
L.append(0)
L.sort()
dis = []
for i in range(N-K+1):
    if 0 in L[i:i+K+1]:
        l = L[i:i+K+1]
        print(l)
        d = abs(l[0]) + abs(l[-1])*2
        dis.append(d)
        d = abs(l[0])*2 + abs(l[-1])
        dis.append(d)
print(min(dis))


### FIXED CODE ###

N, K  = map(int,input().split())
L =list(map(int,input().split()))
Lzero = list(filter(lambda x:x==0,L))
Lright = list(filter(lambda x:x>0,L))
Lleft = list(map(lambda x:abs(x),filter(lambda x:x<0,L)))[::-1]
K -= len(Lzero)
if K <= 0:
    print(0)
    quit()

dis = []
if len(Lright) == 0:
    print(Lleft[K-1])
    quit()
if len(Lleft) == 0:
    print(Lright[K-1])
    quit()
try :
    dis.append(Lright[K-1])
    dis.append(Lleft[K-1])
except:
    pass


for i in range(len(Lright)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lright[i])
        break
    d = 2*Lright[i]
    remain -= (i+1)
    try :
        d += Lleft[remain-1]
        dis.append(d)
    except:
        pass
for i in range(len(Lleft)):
    remain = K
    if i+1 >K:
        break
    elif i+1 == K:
        dis.append(Lleft[i])
        break
    d = 2*Lleft[i]
    remain -= (i+1)
    try:
        d += Lright[remain-1]
        dis.append(d)
    except:
        pass
print(min(dis))
# coding:utf-8
def gcd(x,y):
    if x == y:
        print x
        return
    else if x < y:
        t = x
        x = y
        y = t
    a = x % y
    y_ans = []
    two_ans = []
    for i in range(1,y + 1):
        if y % i == 0:
            y_ans.append(i)
    for i in range(1,a + 1):
        if a % i == 0:
            two_ans.append(i)
    yset = set(y_ans)
    twoset = set(two_ans)
    matched = list(yset & twoset)
    print max(matched) 

n = map(int, raw_input().split())
gcd(n[0],n[1])

### FIXED CODE ###

# coding:utf-8
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
n = map(int, raw_input().split())
n.sort(reverse=True)
print gcd(n[0],n[1])
nkc=input().split()
K=int(nkc[1])
C=int(nkc[2])
s=input()
workday_list=[]
for i,youso in enumerate(s) :
  if youso=='o' :
    workday_list.append(i+1)
    

s=0

current_num=0
current_num1=1
list1=[]
list1.append(workday_list[0])
while(s<=K) :
  
  if current_num1>=len(workday_list):
    break
  elif workday_list[current_num1]-workday_list[current_num]>C :
    current_num=current_num1
    list1.append(workday_list[current_num1])
    s+=1
  else :
    current_num1=current_num1+1
m=0  

current_num2=len(workday_list)-1
current_num3=len(workday_list)-2
list2=[]
list2.append(workday_list[-1])
while(m<K) :
  
  if current_num3<=0:
    break
  elif workday_list[current_num2]-workday_list[current_num3]>C :
    current_num2=current_num3
    list2.append(workday_list[current_num3])
    m+=1
  else :
    current_num3=current_num3-1

list2.reverse()

for i in range(len(list1)) :
  if list1[i]==list2[i] :
    print(list1[i])

### FIXED CODE ###

nkc=input().split()
K=int(nkc[1])
C=int(nkc[2])
s=input()
workday_list=[]
for i,youso in enumerate(s) :
  if youso=='o' :
    workday_list.append(i+1)
    

s=1

current_num=0
current_num1=1
list1=[]
list1.append(workday_list[0])
while(s<K) :
  
  if current_num1>=len(workday_list):
    break
  elif workday_list[current_num1]-workday_list[current_num]>C :
    current_num=current_num1
    list1.append(workday_list[current_num1])
    s+=1
  else :
    current_num1=current_num1+1
m=1  

current_num2=len(workday_list)-1
current_num3=len(workday_list)-2
list2=[]
list2.append(workday_list[-1])
while(m<K) :
  
  if current_num3<0:
    break
  elif workday_list[current_num2]-workday_list[current_num3]>C :
    current_num2=current_num3
    list2.append(workday_list[current_num3])
    m+=1
  else :
    current_num3=current_num3-1

list2.reverse()

flag=True
for i in range(len(list1)) :
  if list1[i]==list2[i] :
    flag=False
    print(list1[i])
if flag :
  print()
n=int(input())
a=list(map(int,input().split()))
print(*a[::-2],*a[n%2::-2])

### FIXED CODE ###

N=int(input())
A=list(input().split())
print(" ".join(A[::-2] + A[N%2::2]))
N, W = map(int, input().split())
w = []
v = []
for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)
w_adjust = []
for i in range(N):
    w_adjust.append(w[i]-w[0])

a = w[0]
dp = [[[0 for i in range(N+1)] for j in range(N*3+10)] for k in range(N+1)]
#i個目までの物のうちk個選んで重さの和がjになる中での最大価値
for i in range(N):
    for j in range(3*N):
        for k in range(N):
            if j + w_adjust[i] > W - a*(k+1):
                dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k])
            else:
                dp[i+1][j+w_adjust[i]][k+1] = max(dp[i+1][j+w_adjust[i]][k+1], dp[i][j][k] + v[i])
                dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k])
ans = [0]
for i in range(N+1):
    if W - a*i >= 0:
        ans.append(dp[N][W-a*i][i])

print(max(ans))


### FIXED CODE ###

N, W = map(int, input().split())
w = []
v = []
for i in range(N):
    a, b = map(int, input().split())
    w.append(a)
    v.append(b)
w_adjust = []
for i in range(N):
    w_adjust.append(w[i]-w[0])

a = w[0]
dp = [[[0 for i in range(N+1)] for j in range(N*3+10)] for k in range(N+1)]
#i個目までの物のうちk個選んで重さの和がjになる中での最大価値
for i in range(N):
    for j in range(3*N):
        for k in range(N):
            if j + w_adjust[i] > W - a*(k+1):
                dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k])
            else:
                dp[i+1][j+w_adjust[i]][k+1] = max(dp[i+1][j+w_adjust[i]][k+1], dp[i][j][k] + v[i])
                dp[i+1][j][k] = max(dp[i+1][j][k], dp[i][j][k])
ans = [0]
for i in range(1, N+1):
    if W - a*i >= 0 and W - a*i < N*3 + 3:
        ans.append(dp[N][W-a*i][i])

if W - a*N > N*3:
    things = W//w[0]
    if things > N:
        ans.append(sum(v))

elif len(ans) == 1:
    things = W//w[0]
    v.sort()
    v.reverse()
    ans_1 = 0
    for i in range(things):
        ans_1 += v[i]
    ans.append(ans_1)

print(max(ans))
print(input().count('1')

### FIXED CODE ###

print(input().count('1'))
import fractions
from functools import reduce

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

#累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    #left.append(math.gcd(left[i],a[i]))
    left[i + 1] = (fractions.gcd(left[i],a[i]))
    #right.insert(0,math.gcd(right[0],a[n - 1 - i]))
    right[n - i - 1] = (fractions.gcd(right[n - i],a[n - 1 - i]))

ans = 0
for i in range(n - 1):
    ans = max(ans,math.gcd(left[i],right[i + 1]))
print(ans)

### FIXED CODE ###

import fractions
from functools import reduce

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

#累積GCD
left = [0] * (n + 1)
right = [0] * (n + 1)
for i in range(n):
    #left.append(math.gcd(left[i],a[i]))
    left[i + 1] = (fractions.gcd(left[i],a[i]))
    #right.insert(0,math.gcd(right[0],a[n - 1 - i]))
    right[n - i - 1] = (fractions.gcd(right[n - i],a[n - 1 - i]))
#print(left)
#print(right)

ans = 0
for i in range(n):
    ans = max(ans,fractions.gcd(left[i],right[i + 1]))
print(ans)
money = int(input())
A = int(input())

if (money % 500) > A:
    print('NO')
else:
    print('YES')


### FIXED CODE ###

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

a.sort()
a.reverse()

Alice = 0
Bob  = 0

for i in range(len(a)):
    if i % 2 == 0:
        Alice = Alice + a[i]
    else:
        Bob = Bob + a[i]

print(Alice - Bob)
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 = 10**4
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 )

a = cmb(n,r,mod)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 = 10**4
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 )

n,k=map(int,input().split())
l=n-k
for i in range(k):
    print((cmb(l+1,i+1,mod)*cmb(k-1,i,mod))%mod)

### 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 = 10**4
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 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 = 10**4
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 )

n,k=map(int,input().split())
l=n-k
for i in range(k):
    print((cmb(l+1,i+1,mod)*cmb(k-1,i,mod))%mod)
N,M = map(int, input().split())

notcalled=list(range(N))
nets=[]
for _ in range(M):
    a,b=map(int, input().split())
    if a in notcalled and b in notcalled:
        nets.append([a,b])
        del notcalled[notcalled.index(a)]
        del notcalled[notcalled.index(b)]
    elif a in notcalled:
        for net in nets:
            if b in net:
                net.append(a)
        del notcalled[notcalled.index(a)]
    elif b in notcalled:
        for net in nets:
            if a in net:
                net.append(b)
        del notcalled[notcalled.index(b)]
    else:
        for net in nets:
            f=True
            if a in net or b in net:
                if f:
                    q=net.copy
                    del net
                else:
                    net.extend(q)

nets.extend(notcalled)
print(len(nets)-1)

### FIXED CODE ###

K=int(input())
print("ACL"*K)
S,T = input (),split ()
A,B = map (int, input (),split ())
U = input ()
if U == S:
  print (A-1,B)
else:
  print (A,B-1)

### FIXED CODE ###

S,T = input ().split ()
A,B = map (int, input ().split ())
U = input ()
if U == S:
  print (A-1,B)
else:
  print (A,B-1)
import math


def main():
	n = int(input())
    a = list(map(int, input().split()))
    print(solution(n, a))  
    gcd_left = [0]
    gcd_right = [0]
    for i in range(n):
        gcd_left.append(math.gcd(gcd_left[i], a[i]))
        # 順に(0とa[-1]), (a[-1]とa[-2]),...の比較
        # 要は右端から順にgcdを求めている
        gcd_right.append(math.gcd(gcd_right[i], a[-(i + 1)]))

    gcd_right = gcd_right[::-1]  # gcd_right[i]がi番目以降のgcdとなるように反転

    ans = []
    for i in range(n):
        ans.append(math.gcd(gcd_left[i], gcd_right[i + 1]))


    return max(ans)

main()

### FIXED CODE ###

import unittest
import fractions


def solution(n, a):
    gcd_left = [0]
    gcd_right = [0]
    for i in range(n):
        gcd_left.append(fractions.gcd(gcd_left[i], a[i]))
        # 順に(0とa[-1]), (a[-1]とa[-2]),...の比較
        # 要は右端から順にgcdを求めている
        gcd_right.append(fractions.gcd(gcd_right[i], a[-(i + 1)]))

    gcd_right = gcd_right[::-1]  # gcd_right[i]がi番目以降のgcdとなるように反転

    ans = []
    for i in range(n):
        ans.append(fractions.gcd(gcd_left[i], gcd_right[i + 1]))


    return max(ans)


class MyTestCase(unittest.TestCase):
    def test1(self):
        self.assertEqual(solution(3, [7, 6, 8]), 2)

    def test2(self):
        self.assertEqual(solution(3, [12, 15, 18]), 6)

    def test3(self):
        self.assertEqual(solution(2, [1000000000, 1000000000]), 1000000000)




if __name__ == '__main__':

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

    unittest.main()
a = raw_input()
b = raw_input()

print ''.join(x+y for x,y in zip(a,b)) + (
  a[-1] if len(a) > len(b) else b[-1] if len(b) > len(a) else ''
)


### FIXED CODE ###

a,b,c = map(int,raw_input().split())

if a - b == b - c:
  print 'YES'
else:
  print 'NO'
#dfs試す
n,m,q=map(int, input().split( ))
qs=tuple(tuple(map(int, input().split( ))) for _ in range(q))
def dfs(ll):
    if len(ll)==n+1:
        sm=0
        for ai,bi,ci,di in qs:
            if ll[bi]-ll[ai]==ci:
                sm+=di 
        return sm
    res=[]
    for i in range(ll[-1]+1,m+1):#+1
        ll2=ll+[i]
        res.append(dfs(ll2))
    return(max(res))
l=[0]
print(dfs(l))


### FIXED CODE ###

#20C10のcombinatrics全探索？
#本番でCでこれ見たら凍るw
#少なくとも combinatrics が組込みでなかったら C問題 じゃないな
n,m,q=map(int, input().split( ))
qs=tuple(tuple(map(int, input().split( ))) for _ in range(q))
import itertools
ans=0
for comb in itertools.combinations(range(1,n+m),n):##+1ない?
    tmp=0
    comb2=[comb[i]-i for i in range(n)]
    for ai,bi,ci,di in qs:
        if comb2[bi-1]-comb2[ai-1]==ci:
            tmp+=di 
    ans=max(ans,tmp)
print(ans)
s = input()
t = input()

sorted_s = sorted(s)
sorted_t = sorted(t,reverse=True)

import sys
N = max(len(sorted_s),len(sorted_t))

for i in range(N):
    if ord(sorted_s[i]) < ord(sorted_t[i]):
        print('Yes')
        sys.exit()
    elif ord(sorted_s[i]) > ord(sorted_t[i]):
        print('No')
        sys.exit()

if ord(sorted_s[N-1]) == ord(sorted_t[N-1]):
    if len(sorted_s) < len(sorted_t):
        print('Yes')
    else:
        print('No')

### FIXED CODE ###

s = input()
t = input()

sorted_s = sorted(s)
sorted_t = sorted(t,reverse=True)

import sys
N = min(len(sorted_s),len(sorted_t))

for i in range(N):
    if ord(sorted_s[i]) < ord(sorted_t[i]):
        print('Yes')
        sys.exit()
    elif ord(sorted_s[i]) > ord(sorted_t[i]):
        print('No')
        sys.exit()

if len(sorted_s) < len(sorted_t):
    print('Yes')
else:
    print('No')
for line in sys.stdin:
    A, B = list(map(int, line.split(' ')))


### FIXED CODE ###

import math

def main():
    N = int(input())
    rt_N = math.ceil(math.sqrt(N))

    mn_ij = 10**12
    for i in range(1, rt_N+1):
        if N % i == 0:
            j = N // i

            mn_ij = min(mn_ij, i+j)
        
        mn_ij = min(mn_ij, i+j)

    # print(list(map(len,[ st, facs]) ))
    print(int(mn_ij-2))

if __name__ == "__main__":
    main()
a = input()
b = input()
A = int(a)
B = int(b)
count = 0
while B > 0:
    B = B - A
    count = count + 1
print(count)


### FIXED CODE ###

S = input()
R = input()
count = 0
for i in range(3):
  if S[i] == R[i]:
    count = count + 1
print(count)