Harryxun/stf_run huggingface dataset:
n = int(input())
l = map(int, input().split())
s = 0
t = 0
for x in l:
  s += x
  t = max(x, t)
if s>t:
  print(Yes)
else:
  print(No)

### FIXED CODE ###

n = int(input())
l = map(int, input().split())
s = 0
t = 0
for x in l:
  s += x
  t = max(x, t)
if s>2*t:
  print('Yes')
else:
  print('No')
n=input()
l=len(n)
s=0
if l%2==1:
    s+=int(n[1:])+1+(int(n[0])-1)*(10**(l-1))
    l-=1
for i in range(int(l/2)):
    s+=9*10**(i*2)
print(s)


### FIXED CODE ###

n=input()
l=len(n)
s=0
if l>1:
    if l%2==1:
        s+=int(n[1:])+1+(int(n[0])-1)*(10**(l-1))
        l-=1
    for i in range(int(l/2)):
        s+=9*10**(i*2)
    print(s)
else:
    print(int(n))
import sys

a = sys.stdin.readline
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in alphabet:
    print(i + " : " + str(a.lower().count(i)) )

### FIXED CODE ###

import sys

a = sys.stdin.read()
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in alphabet:
    print(i + " : " + str(a.lower().count(i)) )
# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

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

passed = 0
penalties = Counter()

ac = {}

for i in range(m):
    p, s = input().split()
    if not ac.get(p, False):
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

print(passed, x)


### FIXED CODE ###

# unihernandez22
# https://atcoder.jp/contests/abc151/tasks/abc151_c
# implementation

class Counter(dict):
    def __missing__(self, i):
        return 0

class BoolDict(dict):
    def __missing__(self, i):
        return False

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

passed = 0
penalties = Counter()

ac = BoolDict()

for i in range(m):
    p, s = input().split()
    if not ac[p]:
        if s == "WA": penalties[p] += 1
        elif s == "AC":
            passed += 1
            ac[p] = True

x = 0
for i in penalties:
    if ac[i]:
        x += penalties[i]

print(passed, x)
import sys
import numpy as np
from numba import jit, void, i8
input = sys.stdin.readline

def main():
    R, C, K = map(int, input().split())

    L_INF = int(1e17)
    dp = np.full((R+1, C+1, 4), -L_INF, dtype=np.int64)
    cell = np.full((R+1, C+1), 0, dtype=np.int64)

    for i in range(K):
        x, y, c = map(int, input().split())
        cell[x-1][y-1] = c

    f(dp, cell, R, C)

    print(dp[R][C][3])

@njit(void(i8[:,:,:],i8[:,:],i8,i8))
def f(dp, cell, R, C):
    dp[0][1][0] = dp[1][0][0] = 0
    for i in range(1, R + 1):
        for j in range(1, C + 1):
            for k in range(4):
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j][k-1])
                dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k])
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k-1] + cell[i-1][j-1])
                if k == 1:
                    dp[i][j][k] = max(dp[i][j][1], dp[i-1][j][3] + cell[i-1][j-1])

if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
import numpy as np
from numba import jit, void, i8
input = sys.stdin.readline

def main():
    R, C, K = map(int, input().split())

    L_INF = int(1e17)
    dp = np.full((R+1, C+1, 4), -L_INF, dtype=np.int64)
    cell = np.full((R+1, C+1), 0, dtype=np.int64)

    for i in range(K):
        x, y, c = map(int, input().split())
        cell[x-1][y-1] = c

    f(dp, cell, R, C)

    print(dp[R][C][3])

@jit(void(i8[:,:,:],i8[:,:],i8,i8))
def f(dp, cell, R, C):
    dp[0][1][0] = dp[1][0][0] = 0
    for i in range(1, R + 1):
        for j in range(1, C + 1):
            for k in range(4):
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j][k-1])
                dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k])
                if k > 0:
                    dp[i][j][k] = max(dp[i][j][k], dp[i][j-1][k-1] + cell[i-1][j-1])
                if k == 1:
                    dp[i][j][k] = max(dp[i][j][1], dp[i-1][j][3] + cell[i-1][j-1])

if __name__ == "__main__":
    main()
#標準入力はN,A,Bで与えられる
numbers = raw_input().split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])

### FIXED CODE ###

#標準入力はN,A,Bで与えられる
numbers =input().split()

for  i in range(len(numbers)):
    numbers[i] = int(numbers[i])

if numbers[0]*numbers[1] <= numbers[2]:
    print(numbers[0]*numbers[1])
else:
    print(numbers[2])
S = input()
N = len(S)
zen = S[:int((N-1)/2)]
kou = S[int((N+3)/2)-1:]
if S = S[::-1] and zen == zen[::-1] and kou == kou[::-1]:
    print("Yes")
else:
    print("No")

### FIXED CODE ###

S = input()
N = len(S)
zen = S[:int((N-1)/2)]
kou = S[int((N+3)/2)-1:]
if S == S[::-1] and zen == zen[::-1] and kou == kou[::-1]:
    print("Yes")
else:
    print("No")
# -*- coding: utf-8 -*-

import sys

sum = [0]*37
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                sum[a+b+c+d] += 1
for line in sys.stdin:
    print sum[int(line)]

### FIXED CODE ###

# -*- coding: utf-8 -*-

import sys

sum = [0]*37
for a in range(10):
    for b in range(10):
        for c in range(10):
            for d in range(10):
                sum[a+b+c+d] += 1
for line in sys.stdin:
    n = int(line)
    if n >= 0 and n <= 36:
        print sum[n]
    else:
        print "0"
S,T=map(str,input().split())
count=0
for i in range(3):
    if S[i]==T[i]:
        count+=1
print(count)

### FIXED CODE ###

S=str(input())
T=str(input())
count=0
for i in range(3):
    if S[i]==T[i]:
        count+=1
print(count)
N = int(input())
l = list(map(int,input().split()))
count = 1
max = l[0]
for i in range(l):
  if max <= l[i]:
   	count += 1
    max = l[i]
  else:
print(count)

### FIXED CODE ###

n = int(input())
l = list(map(int,input().split()))
max = l[0]
count = 0
for i in range(n):
  if l[i] >= max:
    count += 1
    max = l[i]
    
print(count)
str = input()
if str = "A":
  print(T)
elif str = "T":
  print(A)
elif str = "C":
  print(G)
elif str = "G":
  print(C)

### FIXED CODE ###

str = input()
if str == "A":
  print("T")
elif str == "T":
  print("A")
elif str == "C":
  print("G")
elif str == "G":
  print("C")
import math
A, B, H, M, = float(open(0))

K = abs(math.pi*M/30 - math.pi*H/6)

print(math.sqrt(A**2+B**2 - 2*A*B*math.cos(K)))


### FIXED CODE ###

import math
A, B, H, M = map(int, input().split())


arg_b = math.pi * float(M) / 30
arg_a = (math.pi / 6) * (float(H) + float(M)/60) 
K = abs(arg_b - arg_a)
C = math.sqrt(A*A+B*B - 2*A*B*math.cos(K))
print(C)
from math import factorial

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

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

for i in range(1,k+1):
    print((combinations_count(n-k+1,i) * combinations_count(k-1,i-1))%(10**9+7))

### FIXED CODE ###

from math import factorial

def combinations_count(n, r):
    return factorial(n) // (factorial(n - r) * factorial(r))

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

for i in range(1,k+1):
    if i <= n-k+1:
        print((combinations_count(n-k+1,i)%(10**9+7)) * combinations_count(k-1,i-1) %(10**9+7))
    else:
        print(0)
from sys import setrecursionlimit
setrecursionlimit(10 ** 7)
n, m = map(int, input().split())
P = [[] for i in range(m)]   #Pass
for i in range(m):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1  
    P[a].append(b)
    P[b].append(a)
#print(P)

c = 0   #cursol
R = [0 for i in range(m)]  #Record
tm = 1  #time

def all_search_dfs(c:int, tm:int, R:list):
    if R[c] == 0:
        R[c] = 1
        if  tm < n:
            return point_calculate(c, tm, R)
        elif tm == n:
            return 1
        else:
            return 0
    else:
        return 0

def point_calculate(c:int, tm:int, R:list):
    #print('c = ', c)
    p = 0
    #print('check = ', P[c])
    for i in range(len(P[c])):
        R2 = R[:]
        #print('before = ', R2)
        tmp = all_search_dfs(P[c][i], tm + 1, R2)
        #print('after = ', R2)
        #print('tmp = ', tmp)
        p += tmp
        #print('p = ', p)
    return p

print(all_search_dfs(c, tm, R))

### FIXED CODE ###

from sys import setrecursionlimit
setrecursionlimit(4100000)
n, m = map(int, input().split())
P = [[] for i in range(n)]   #Pass
for i in range(m):
    a, b = map(int, input().split())
    a, b = a - 1, b - 1  
    P[a].append(b)
    P[b].append(a)
#print(P)

c = 0   #cursol
R = [0 for i in range(n)]  #Record
tm = 1  #time

def all_search_dfs(c:int, tm:int, R:list):
    if R[c] == 0:
        R[c] = 1
        if  tm < n:
            return point_calculate(c, tm, R)
        elif tm == n:
            return 1
        else:
            return 0
    else:
        return 0

def point_calculate(c:int, tm:int, R:list):
    #print('c = ', c)
    p = 0
    #print('check = ', P[c])
    for i in range(len(P[c])):
        R2 = R[:]
        #print('before = ', R2)
        tmp = all_search_dfs(P[c][i], tm + 1, R2)
        #print('after = ', R2)
        #print('tmp = ', tmp)
        p += tmp
        #print('p = ', p)
    return p

print(all_search_dfs(c, tm, R))
# -*- coding: utf-8 -*-
date = input()
# 出力
print "2018" + date[4:]

### FIXED CODE ###

# -*- coding: utf-8 -*-
date = input()
# 出力
print("2018", date[4:], sep="")
while True:
    (x, y) = [int(i) for i in sys.stdin.readline().split()]
    if x == 0 == y:
        break
    if x > y:
        z = x
        x = y
        y = z
 
    print(x, y)

### FIXED CODE ###

import sys
while True:
    (x, y) = [int(i) for i in sys.stdin.readline().split()]
    if x == 0 == y:
        break
    if x > y:
        z = x
        x = y
        y = z
 
    print(x, y)
A = list(map(int,input().split()))
A.sort()
ret = 0
ret += A[2]-A[1]
A[1] += ret
A[0] += ret
ret += (A[1]-A[0])//2
if (A[1]-A[0])%2==1:
  ret += 2
print(ret)


### FIXED CODE ###

N = int(input())
mini = float("inf")
for A in range(1,N-1+1):
  mini = min(mini,sum([int(digit) for digit in str(A)])+sum([int(digit) for digit in str(N-A)]))
print(mini)
N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(p)
ss=sorted(list(set(S)))
for i in range(len(ss)):
    a =[]
    b =[]
    for j in range(N):
        if ss[i]==S[j]:
            a.append(j)
            b.append(P[i])
    c = sorted(b).reverse()
    for k in c:
        for j in range(len(b)):
            if k == b[j]:
                print(a[j])

### FIXED CODE ###

N =int(raw_input())
S =[]
P =[]
for i in range(N):
    s,p=map(str,raw_input().split())
    S.append(s)
    P.append(int(p))
ss=sorted(list(set(S)))
for sss in ss:
    a =[]
    b =[]
    for j in range(N):
        if sss==S[j]:
            a.append(j)
            b.append(P[j])
    if len(b)>0:
        c = sorted(b,reverse=True)
        #print c,b
        for k in c:
            for j in range(len(b)):
                if k == b[j]:
                    print(a[j]+1)
n,a,b=map(int,input().split())
c=0
for i in range(1,n+1):
  w=str(i)
  d
  for j in range(len(w)):
    d+=int(w[j])
  if a<=d<=b:
    c+=1
print(c)
  

### FIXED CODE ###

n,a,b=map(int,input().split())
c=0
for i in range(1,n+1):
  w=str(i)
  d=0
  for j in range(len(w)):
    d+=int(w[j])
  if a<=d<=b:
    c+=i
print(c)
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

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


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N-1)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

paint(tmp[0][0], -1)

print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

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


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
x, y = [int(i) for i in input().split(" ")]
num = []
if x >= y:
    z = x % y
    for zzz in range(z + 1):
        if z % zzz == 0 and x % zzz == 0:
            num.append(zzz)
    print(max(num))
elif y > x:
    z = y % x
    for zzz in range(z + 1):
        if z % zzz == 0 and y % zzz == 0:
            num.append(zzz) 
    print(max(num))

### FIXED CODE ###

def gdc(x, y):
    if x % y == 0:
        return y
    else:
        return gdc(y, x%y)


if __name__ == '__main__':
    x, y = [int(i) for i in input().split(" ")]
    print(gdc(x, y))
L, R = map(int, input().split())
mod = 2019

L = L % mod
R = R % mod
if L >= R:
    print(0)
else:
    ans = float('inf')
    for i in range(L, R+1):
        for j in range(i+1, R+1):
            ans = min(ans, (i*j)%mod)
print(ans)


### FIXED CODE ###

L, R = map(int, input().split())
mod = 2019

if R - L >= mod:
    print(0)
else:
    L = L % mod
    R = R % mod
    if L >= R:
        print(0)
    else:
        ans = float('inf')
        for i in range(L, R+1):
            for j in range(i+1, R+1):
                ans = min(ans, (i * j) % mod)
        print(ans)
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(n-2):
  if ((p[i]>p[i+1]) and (p[i+1]>p[i+2]) and (p[i]>p[i+2])) or ((p[i]<p[i+1]) and (p[i+1]<p[i+2]) and (p[i]<p[i+2])):
    count += 1
print(count)

### FIXED CODE ###

s = input()
result = 0
count = 0
for i in s:
  if s.count(i) == 2:
    result = 0
    count+=1
  else:
    count = 5
    break
if result == 1 or count > 4:
  print("No")
else:
  print("Yes")
J=list(input())
n=len(J)

def dfs_formula(i,f):
    if i==n-1:
        return [f]
    return dfs_formula(i+1,f+"+"+J[i+1])+dfs_formula(i+1,f+"-"+J[i+1])
    
def dfs_sum(i,f):
    if i==n-1:
        return f
    return str(dfs_sum(i+1,f+int(J[i+1])))+" "+str(dfs_sum(i+1,f-int(J[i+1])))

A=dfs_formula(0,J[0])
S=dfs_sum(0,int(J[0]))

for i in range(len(S)):
    if S[i]=='7':
        print(A[i]+"=7")
        break

### FIXED CODE ###

J=list(input())
n=len(J)

def dfs(i,f,sum_num):
    if i==n-1:
        if sum_num==7:
            print(f+"=7")
            exit()
    else:
        dfs(i+1,f+"+"+J[i+1],sum_num+int(J[i+1]))
        dfs(i+1,f+"-"+J[i+1],sum_num-int(J[i+1]))
dfs(0,J[0],int(J[0]))
a,b = map(int,input().split())
c = list(map(int,input().split()))
sum = 0
for i in range(0,n,1):
  sum = sum + c[i]
count = 0
vote = (1/(4*b))*sum
for j in c:
  if j>=vote:
    count = count + 1
if count>=b:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a,b = map(int,input().split())
c = list(map(int,input().split()))
sum = 0
for i in c:
  sum = sum + i
vote = (1/(4*b))*sum
count = 0
for j in c:
  if j>=vote:
    count = count + 1

if count>=b:
  print("Yes")
else:
  print("No")
N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for next in graph[now]:
        if next==prev:
            continue
        point[next]=point[next]+point[now]
        dfs(next,now)
dfs(0)
print(*point)

### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 6)
def input():
    return sys.stdin.readline()[:-1]

N,Q=map(int,input().split())
graph=[[]for _ in range(N)]
point=[0]*N
for _ in range(N-1):
    a,b=map(int,input().split())
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
for _ in range(Q):
    a,b=map(int,input().split())
    a=a-1
    point[a]=point[a]+b

def dfs(now,prev=-1):
    for next in graph[now]:
        if next==prev:
            continue
        point[next]=point[next]+point[now]
        dfs(next,now)
dfs(0)
print(*point)
while True:
  t = raw_input().split(',')
  l = [int(x) for x in t[:10]]
  v = [int(x) for x in t[10:]]
  time = float(sum(l)) / float(sum(v))
  dis = time * float(v[0])

  s = 0
  for (i, x) in enumerate(l):
    s += x
    if s >= int(dis):
      print i + 1
      break

### FIXED CODE ###

import sys

for line in iter(sys.stdin.readline, ''):
  t = line.strip().split(',')
  l = [int(x) for x in t[:10]]
  v = [int(x) for x in t[10:]]
  time = float(sum(l)) / float(sum(v))
  dis = time * float(v[0])

  s = 0
  for (i, x) in enumerate(l):
    s += x
    if s >= int(dis):
      print i + 1
      break
n,m = map(int,raw_input().split())
a = []
buf = -111
for q in range(m):
  a.append(int( raw_input() ))
  buf = a[q]
  if buf - a[q] == 1:
    print 0
    exit(0)

now = [0]*100001

if m == 0:
  now[0] = 1
  now[1] = 1
  for q in range(2,n+1):
    now[q] = (now[q-1] + now[q-2]) % 1000000007
  print now[q] % 1000000007
  exit(0)
    
now[0] = 1
if a[0] == 1: now[1] = 0
else: now[1] = 1

for q in range(2,n+1):
  if q in a: continue
  now[q] = (now[q-1] + now[q-2]) % 1000000007
  
print now[q] % 1000000007

### FIXED CODE ###

n,m = map(int,raw_input().split())
a = []
buf = -111
for q in range(m):
  a.append(int( raw_input() ))
  buf = a[q]
  if buf - a[q] == 1:
    print 0
    exit(0)

if n==1:
  print 1
  exit(0)
if n==2:
  if m==1:
    print 1
    exit(0)
  if m==0:
    print 2
    exit(0)

now = [-1]*100001

if m == 0:
  now[0] = 1
  now[1] = 1
  for q in range(2,n+1):
    now[q] = (now[q-1] + now[q-2]) % 1000000007
  print now[q] % 1000000007
  exit(0)
    
now[0] = 1
if a[0] == 1: now[1] = 0
else: now[1] = 1

for q in a:
  now[q] = 0

for q in range(2,n+1):
  if now[q] != -1: continue
  now[q] = (now[q-1] + now[q-2]) % 1000000007
  
print now[q] % 1000000007
s = list(input())
t = list(input())
ans = []
for i in range(len(s)-len(t)):
  ans.append(0)
  for j in range(len(t)):
    if s[i+j] == t[j]:
      ans[i] += 1
print(len(t) - max(ans))

### FIXED CODE ###

s = list(input())
t = list(input())
ans = []
if len(s)-len(t) == 0:
  an = 0
  for j in range(len(t)):
      if s[j] == t[j]:
        an += 1
  print(len(t)-an)
else:
  for i in range(len(s)-len(t)):
    ans.append(0)
    for j in range(len(t)):
      if s[i+j] == t[j]:
        ans[i] += 1
  print(len(t) - max(ans))
import sys
sys.setrecursionlimit(100000)

from functools import lru_cache

N = int(input())
A = []
for i in range(0,N):
    A.append(list(map(int,input().split())))
@lru_cache(None)
def dfs(d,h,pre):
    if d == N - 1:
        return h
    tmp = [0] 
    for idx,a in enumerate(A[d]):
        if idx != pre:
            res = dfs(d + 1,h + a,idx)
            tmp.append(res)
    return max(tmp)


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

### FIXED CODE ###

N = int(input())
A = []
for i in range(0,N):
    A.append(list(map(int,input().split())))

dp = [[0 for _ in range(3)] for _ in range(N)]
for i in range(N):
    for j in range(3):
        if i == 0:
            dp[i][j]= A[i][j]
        else:
            tmp = [0] 
            for k in range(3):
                if j !=k:
                    tmp.append(dp[i-1][k])
            dp[i][j] = max(tmp) + A[i][j]
print(max(dp[-1]))
N=int(input())
A=[a]
if N==1:
    print("a")
    exit()
else:
    S=abcdefghijklmn
    slist=list(S) 
    for i in range(2,N+1):
        temp=[[]*N]
        for j in range(i-1):
            for w in A[j]:
                for u in slist[:j+1]:
                    temp[j].append(w+u)
                temp[j+1].append(w+slist[j+1])
        A=temp
    for j in range(N):
        for t in A[j]:
            print(t)

### FIXED CODE ###

N=int(input())
A=["a"]
if N==1:
    print("a")
    exit()
else:
    S="abcdefghijklmn"
    slist=list(S) 
    for i in range(2,N+1):
        temp=[[] for _ in range(N)]
        for j in range(i-1):
            for w in A[j]:
                for u in slist[:j+1]:
                    temp[j].append(w+u)
                temp[j+1].append(w+slist[j+1])
        A=temp
    B=[]    
    for j in range(N):
        for t in A[j]:
            B.append(t)
    B.sort()
    for i in range(len(B)):
        print(B[i])
from collections import defaultdict
from bisect import bisect_right
s = input()
t = input()
ss = set(s)
tt = set(t)
count = 0
for i in tt:
  if not i in ss:
    print(-1)
    break
else:
  dic = defaultdict(list)
  for i in range(len(s)):
    dic[s[i]] += [i+1]
  ans = 0
  for i in range(len(t)):
    x = ans%len(s)
    if dic[t[i]][-1]+1<=x:
      ans = ans - x + len(s) + dic[t[i]][0]
    else:
      ind = bisect_right(dic[t[i]], x)
      ans = ans - x + dic[t[i]][ind]
  print(ans)

### FIXED CODE ###

from collections import defaultdict
from bisect import bisect_right
s = input()
t = input()
ss = set(s)
tt = set(t)
count = 0
for i in tt:
  if not i in ss:
    print(-1)
    break
else:
  dic = defaultdict(list)
  for i in range(len(s)):
    dic[s[i]] += [i+1]
  ans = 0
  for i in range(len(t)):
    x = ans%len(s)
    if dic[t[i]][-1]<=x:
      ans = ans - x + len(s) + dic[t[i]][0]
    else:
      ind = bisect_right(dic[t[i]], x)
      ans = ans - x + dic[t[i]][ind]
  print(ans)
n, k = map(int, input().split())
pl = list(map(int, input().split()))

def cal_p(x):
    return x*(x+1)/2/x

tmp = []
tmp_sum = []
# ans = 0
for i in range(n):
    tmp. append(cal_p(pl[i]))
    if i >= k:
        tmp_sum.append(sum(tmp[i+1-k:i+1]))

print(max(tmp_sum))


### FIXED CODE ###

n, k = map(int, input().split())
pl = list(map(int, input().split()))

dp = [0] * (n + 1)

for i in range(n):
    dp[i+1] = dp[i] + (pl[i] + 1)/2

ans = 0
for i in range(k, n+1):
    ans = max(ans, dp[i] - dp[i-k])

print(ans)
import sqrt
N,D=map(int,input())
ans=0
for _ in range(N):
  p,q=map(int,input().split())
  if math.sqrt(p**2+q**2)<=D:
    ans+=1
print(ans)

### FIXED CODE ###

import math
N,D=map(int,input().split())
ans=0
for _ in range(N):
  p,q=map(int,input().split())
  if math.sqrt(p**2+q**2)<=D:
    ans+=1
print(ans)
A,B=int(input())
if B%A==0:
  ptint(A+B)
else:
  print(B-A)

### FIXED CODE ###

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

if B%A==0:
  print(A+B)
else:
  print(B-A)
import math
a,b,x =map(int,input().split( ))
if x >= (a**2*b/2):
    k=2*x/(a**2)-b
    cos=math.sqrt((b-k)**2/((a**2)+(b-k)**2))
    print(90-math.degrees(math.acos(cos)))
else:
    k=2*x/(a*b)
    cos=math.sqrt(b**2/(b**2+k**2))
    print(90-math.degrees(math.acos(cos)))

### FIXED CODE ###

import math
N =int(input())
sq=int(math.sqrt(N))
for i in range(sq,0,-1):
    if N%i==0:
        print(i+N//i-2)
        break