Harryxun/stf_run huggingface dataset:
N = int(input())
search_max = int(sqrt(N))
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)

### FIXED CODE ###

N = int(input())
search_max = int(N**0.5)
 
min_number = 10**12
for x in range(1, search_max + 1):
    if N % x == 0:
        y = N // x
        if x + y < min_number:
         
            min_number = x + y
print(min_number-2)
m = {}

n = int(input())
for i in range(n):
    s = input().strip()
    if s not in m:
        m[s] = 1
    else:
        m[s] += 1

m = int(input())
for i in range(m):
    t = input().strip()
    if t not in m:
        m[t] = -1
    else:
        m[t] -= 1

res = max(m.values())
if res<0:
    res = 0

print(res)

### FIXED CODE ###

memo = {}

n = int(input())
for i in range(n):
    s = input().strip()
    if s not in memo:
        memo[s] = 1
    else:
        memo[s] += 1

n = int(input())
for i in range(n):
    s = input().strip()
    if s not in memo:
        memo[s] = -1
    else:
        memo[s] -= 1

res =  max(memo.values())
if res<0:
    res = 0

print(res)
n, m = map(int, input().split()) 
card = list(map(int, input().split()))
card.sort()
command = [list(map(int, input().split())) for i in range(m)]
command.sort(key=lambda x: x[1], reverse=True)

ind = 0
for i in command:
    for j in range(i[0]):
        if card[ind] >= i[1]:
            break
        card[ind] = i[1]
        ind += 1
    else:
        continue
    break
print(sum(card))

### FIXED CODE ###

n, m = map(int, input().split()) 
card = list(map(int, input().split()))
card.sort()
command = [list(map(int, input().split())) for i in range(m)]
command.sort(key=lambda x: x[1], reverse=True)

ind = 0
maxNum = len(card)
for i in command:
    for j in range(i[0]):
        if maxNum < ind+1:
            break
        if card[ind] >= i[1]:
            break
        card[ind] = i[1]
        ind += 1
    else:
        continue
    break
print(sum(card))
n, k = map(int, input().split())
s = list(input())
s[k] = s[k].lower()
print("".join(s))

### FIXED CODE ###

n, k = map(int, input().split())
s = list(input())
s[k-1] = s[k-1].lower()
print("".join(s))
a = int(input())
b = int(input())
if(a*b %2 == 1):
    print("Odd")
else:
    print("Even")

### FIXED CODE ###

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

if(a*b %2 == 0):
    print("Even")
else:
    print("Odd")
n = int(input())
a_l = list(map(int,input().split()))
ia = list(enumerate(a_l))
del_l = []
for j in range(n):
    if ia[j][1] >= n-1:
        del_l.append(j)
for j in del_l[::-1]:
    del ia[j]
        
count = 0
i = 0
while True:
    if i > len(ia)-1:
        break
    i1, a1 = ia[i]
    if a1 >= n-1-i1:
        del ia[i]
        continue
    for i2, a2 in ia[i1+a1+1:n]:
        if a2 >= n-1-i1:
            del ia[i2]
            continue
        if (i2-i1) == (a2+a1):
            count += 1
    i += 1

print(count)



### FIXED CODE ###

n = int(input())
a_l = list(map(int,input().split()))
ia = list(enumerate(a_l))

x_dict = {}
y_dict = {}
for i, a in ia:
    x = i+a
    y = i-a
    if x in x_dict:
        x_dict[x] += 1
    else:
        x_dict[x] = 1
    if y in y_dict:
        y_dict[y] += 1
    else:
        y_dict[y] = 1

count = 0
for xkey in x_dict.keys():
    if xkey in y_dict:
        count += x_dict[xkey] * y_dict[xkey]

print(count)
A = int(input())
B = int(input())
C = int(input())
D = int(input())

areaAB = (A*B)
areaCD = (C*D)

if areaAB == areaCD:
  print (areaAB)
  
if areaAB > areaCD:
  print (areaAB)

if areaCD > areaAB:
  print (areaCD)


### FIXED CODE ###

a,b,c,d = map(int, input().split())

ab = a * b
cd = c * d

if ab == cd:
    print(int(ab))
elif ab > cd:
    print(int(ab))
else:
    print(int(cd))
import math
a,b = input().split()
b = int(b*100)
print((a*b)//100)



### FIXED CODE ###

a,b=input().split()
a=int(a)
b=int("".join(b.split(".")))
print((a*b)//100)
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]


n,m = map (int,input().split())
a = [0] * n
b = [0] * n
box = [[] for i in range(n)]
s = deque()
ans = [-1] * (n-1)
for i in range(n):
    a[i],b[i] = map (int,input().split())
    box[a[i]-1].append (b[i])
    box[b[i] - 1].append (a[i])
for i in range(len(box[0])):
    s.append([1,box[0][i]])

while len (s) > 0:
    k = s.popleft()

    if ans[k[1] - 2] == -1:
        ans[k[1] - 2] = k[0]

        for i in range(len(box[k[1] - 1])):
            s.append([k[1], box[k[1] - 1][i]])

print('Yes')
for i in range(len(ans)):
    print(ans[i])



### FIXED CODE ###

import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque


def S(): return sys.stdin.readline().rstrip()


def I(): return int(sys.stdin.readline().rstrip())


def MI(): return map(int, sys.stdin.readline().rstrip().split())


def MS(): return map(str, sys.stdin.readline().rstrip().split())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


def LS(): return list(sys.stdin.readline().rstrip().split())


# N = I()
# A = [LI() for _ in range(N)]


n, m = map(int, input().split())
a = [0] * m
b = [0] * m
box = [[] for i in range(n)]
s = deque()
ans = [-1] * (n - 1)
for i in range(m):
    a[i], b[i] = map(int, input().split())
    box[a[i] - 1].append(b[i])
    box[b[i] - 1].append(a[i])
for i in range(len(box[0])):
    s.append([1, box[0][i]])

while len(s) > 0:
    k = s.popleft()

    if ans[k[1] - 2] == -1 and k[1] - 2 != -1:
        ans[k[1] - 2] = k[0]

        for i in range(len(box[k[1] - 1])):
            s.append([k[1], box[k[1] - 1][i]])

print('Yes')
for i in range(len(ans)):
    print(ans[i])
a,b,h=map(int, input().split())

print((a+b)*h/2)



### FIXED CODE ###

a = int(input())
b = int(input())
h = int(input())
print((a+b)*h//2)
import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N = I()
A = LI()
for i in range(N):
    A[i] -= i+1
A.sort()

x = A[N//2]
y = A[(N-1)//2]
z = (A[x]+A[y])//2

print(sum(abs(A[i]-z) for i in range(N)))


### FIXED CODE ###

import sys

sys.setrecursionlimit(10**7)
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int,sys.stdin.readline().rstrip().split())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり
def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり
def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし


N = I()
A = LI()
for i in range(N):
    A[i] -= i+1
A.sort()


def f(x):
    return sum(abs(A[i]-x) for i in range(N))


print(f((A[(N-1)//2]+A[N//2])//2))
l, r = map(int, input().split())
if r //2019 > l //2019:
    print(0)
else:
    res = 2018
    for i in range(l%2019, (r%2019)+1):
        for j in range(i+1, (r%2019)+1):
            res = min(res, (i*j)%2019)
    print(res)


### FIXED CODE ###

n = int(input())
aa = list(map(int, input().split()))
total_odd = sum(aa[1::2])
total_eve = sum(aa[0::2])
tmp = total_eve - total_odd
print(tmp)
for i in range(1,n):
    tmp = 2*aa[i-1] - tmp
    print(tmp)
# -*- coding: utf-8 -*-
# 整数の入力
# from functools import reduce
from collections import defaultdict

sys.setrecursionlimit(1000000)


def main():
    # n, q
    n, q = map(int, input().split())

    trees = [[] for i in range(n+1)]
    # a, b
    for _ in range(0, n - 1):
        a, b = map(int, input().split())
        trees[a].append(b)
        trees[b].append(a)

    values = [0 for i in range(n+1)]
    # p, x
    for _ in range(0, q):
        p, x = map(int, input().split())
        values[p] += x
    process(1, -1, trees, values)
    print(*values[1:])


def process(i, parent, trees, values):
    for j in trees[i]:
        if j == parent:
            continue
        values[j] += values[i]
        process(j, i, trees, values)


if __name__ == "__main__":
    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-
# 整数の入力
# from functools import reduce
import sys
from collections import defaultdict

sys.setrecursionlimit(1000000)


def main():
    # n, q
    n, q = map(int, input().split())

    trees = [[] for i in range(n+1)]
    # a, b
    for _ in range(0, n - 1):
        a, b = map(int, input().split())
        trees[a].append(b)
        trees[b].append(a)

    values = [0 for i in range(n+1)]
    # p, x
    for _ in range(0, q):
        p, x = map(int, input().split())
        values[p] += x
    process(1, -1, trees, values)
    print(*values[1:])


def process(i, parent, trees, values):
    for j in trees[i]:
        if j == parent:
            continue
        values[j] += values[i]
        process(j, i, trees, values)


if __name__ == "__main__":
    main()
n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]-1]+x[p[i]-1])


### FIXED CODE ###

n=int(input())
t=list(map(int,input().split()))
m=int(input())
p,x=[],[]
for _ in range(m):
  _p,_x=map(int,input().split())
  p.append(_p-1)
  x.append(_x)
s=sum(t)
for i in range(m):
  print(s-t[p[i]]+x[i])
n = int(input())
l_i_1 = 2
l_i_2 = 1
while n>=2:
  l_i = l_i_1 + l_i_2
  n -= 1
  l_i_1= l_i_2
  l_i_2 = l_i
print(l_i)

### FIXED CODE ###

n = int(input())
l_i_1 = 2
l_i_2 = 1
if n >= 2:
  while n>=2:
    l_i = l_i_1 + l_i_2
    n -= 1
    l_i_1= l_i_2
    l_i_2 = l_i
  print(l_i)
elif n==1:
  print(1)
else:
  print(2)
#!/usr/bin/env python3
# coding: utf-8
# import pprint
# import numpy as np
# import code
# import functools

if __debug__:
    def debug(arg):
        pass
else:
    import sys
    def debug(arg):
        debug = lambda *x: None
        print(arg, file=sys.stderr)

n, k = (int(x) for x in input().split())

d = abs(n - k)
debug(d)
if(n >= k):
    a = n % d
    debug(a)
else:
    a = n
    debug(a)
debug([a, k])
m = min(a, abs(a - k))
debug(m)
print(m)


### FIXED CODE ###

#!/usr/bin/env python3
# coding: utf-8

def debug(arg):
    if __debug__:
        pass
    else:
        import sys
        print(arg, file=sys.stderr)

def main():
    N, K = map(int, open(0).read().split())
    debug([N, K])
    r = N % K
    a = min(r, K - r)
    print(a)

if __name__ == "__main__":
    main()
N = int(input())
X_list = list(map(int, input().split()))

hp_list = []
for p in range(int(min(X_list)), int(max(X_list))):
    hp = 0
    for x in X_list:
        hp += abs(x - p) ** 2
    hp_list.append(hp)

print(min(hp_list))


### FIXED CODE ###

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

hp_list = []
for p in range(int(min(X_list)), int(max(X_list))):
    hp = 0
    for x in X_list:
        hp += abs(x - p) ** 2
    hp_list.append(hp)

print(min(hp_list) if len(hp_list) > 0 else 0)
N = int(input())
A = 1
B = 1
C = 1
answer = 0
while C < N:
    B = 1
    while B < N:
        A = 1
        while A < N:
            if (A * B) + C == N:
                answer += 1

            A += 1

        B += 1

    C += 1

print(answer)


### FIXED CODE ###

S = input()
if S[len(S)-1] == 's':
    answer = S + 'es'
else:
    answer = S + 's'
print(answer)
import fractions

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

res = 0
tmp = math.ceil(m/n)
for i in range(1, tmp+1):
    res = (max(res, fractions.gcd(i, m-((n-1)*i))))
print(res)


### FIXED CODE ###

import math

n, m = map(int, input().split())
array = []
for i in range(1, int(math.sqrt(m)+1)):
    if m % i == 0:
        array.append([i, m//i])

diff = float("inf")
res = 0
for i, j in array:
    if i >= n:
        res = max(res, j)
    if j >= n:
        res = max(res, i)
print(res)
from bisect import bisect_right
INF = 10**18
A, B, Q = map(int, input().split())
als = [int(input()) for i in range(A)]
bls = [int(input()) for i in range(B)]
als = [-INF]+als+[INF]
bls = [-INF]+bls+[INF]

for i in range(Q):
  x = int(input())
  ai = bisect_right(x,als)
  bi = bisect_right(x,bls)
  res = INF
  for S in [als[ai], als[ai-1]]:
    for T in [bls[bi], bls[bi-1]]:
      d1, d2 = abs(S-x)+abs(T-S), abs(T-x)+abs(S-T)
      res = min(res,d1,d2)
  print(res)

### FIXED CODE ###

from bisect import bisect_left
INF = 10**18
A, B, Q = map(int, input().split())
als = [int(input()) for i in range(A)]
bls = [int(input()) for i in range(B)]
als = [-INF]+als+[INF]
bls = [-INF]+bls+[INF]

for i in range(Q):
  x = int(input())
  ai = bisect_left(als,x)
  bi = bisect_left(bls,x)
  res = INF
  for S in [als[ai], als[ai-1]]:
    for T in [bls[bi], bls[bi-1]]:
      d1, d2 = abs(S-x)+abs(T-S), abs(T-x)+abs(S-T)
      res = min(res,d1,d2)
  print(res)
N = input()
rN = N[::-1]

res = 0
add = False

for i, n in enumerate(rN):
    p = int(n)
    if add:
        p += 1
    if p == 10:
        continue
    elif p == 5:
        if len(N) >= i+1 and int(rN[i+1]) >= 5:
            add = True
            res += p
        else:
            add = False
            res += p
    elif p < 5:
        add = False
        res += p
    else:
        add = True
        res += 10-p

if add:
    res += 1

print(res)


### FIXED CODE ###

N = input()
rN = N[::-1]

res = 0
add = False

for i, n in enumerate(rN):
    p = int(n)
    if add:
        p += 1
    if p == 10:
        continue
    elif p == 5:
        if len(N) > i+1 and int(rN[i+1]) >= 5:
            add = True
            res += p
        else:
            add = False
            res += p
    elif p < 5:
        add = False
        res += p
    else:
        add = True
        res += 10-p

if add:
    res += 1

print(res)
N, K, Q = input().strip().split()
N, K, Q = [int(N), int(K), int(Q)]
A = [0] * (Q+1)  # index調整のため、長さQ+1のリストとする
for i in range(1, Q+1):
    A[i] = int(input())

# まず、全員が毎回負けた場合の点数は
points = [K - Q] * (N+1)

for i in range(1, Q+1) # 各ラウンドについて勝者に+1ポイント与える
    points[A[i]] += 1

for i in range(1, N+1):
    print('Yes' if points[i] > 0 else 'No')

### FIXED CODE ###

N, K, Q = input().strip().split()
N, K, Q = [int(N), int(K), int(Q)]
A = [0] * (Q+1)  # index調整のため、長さQ+1のリストとする
for i in range(1, Q+1):
    A[i] = int(input())

# まず、全員が毎回負けた場合の点数は
points = [K - Q] * (N+1)

for i in range(1, Q+1): # 各ラウンドについて勝者に+1ポイント与える
    points[A[i]] += 1

for i in range(1, N+1):
    print('Yes' if points[i] > 0 else 'No')
n = int(raw_input())
a = map(int, raw_input().split())
print " ".join(map(str, a))
for i in range(1, n):
    v = a[i]
    j = i -1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j--
    a[j+1] = v
    print " ".join(map(str, a))


### FIXED CODE ###

n = int(input())
num = list(map(int, input().split()))
cnt = 1
print(" ".join(map(str,num)))
while cnt < len(num):
    for i in range(cnt, 0, -1):
        if num[i] < num[i-1]:
            num[i], num[i-1] = num[i-1], num[i]
    print(" ".join(map(str,num)))
    cnt+=1
s=int(input())
k=int(input())


if str(s)[0]=='1':
    print(str(s)[1])
else:
    print(str(s)[0])

### FIXED CODE ###

s=int(input())
k=int(input())

for i in range(min(len(str(s)),k)):
    if str(s)[i]!='1':
        print(str(s)[i])
        exit()
print(1)
N = int(input())
A = list(map(int,input().split()))
import fractions
X1 = A[0]
Y = 1
for i in range(1, N):
    X2 = X1 // fractions.gcd(X1, A[i]) * A[i]
    Y *= int(X2/X1)
    Y += int(X2/A[i])
    Y = Y%(10**9+7)
    X1 = X2
print(Y)

### FIXED CODE ###

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

import fractions

X = A[0]
for i in range(1, N):
    X = X*A[i] // fractions.gcd(X, A[i])

output = 0
D =10**9+7
X = X%D

for i in range(N):
    output += X*pow(A[i],D-2,D)%D
    output = output % (10**9+7)
print(int(output))
import sys
sys.setrecursionlimit(1000000000) 

def f(n):
    if n <= 1:
        return 1
    return n * f(n-2)

n = int(input())
F_s = str(f(n))
ans = 0

for i in range(0, len(F_s))[::-1]:
    if int(F_s[i]) == 0:
       ans += 1
    else:
         break
     
print(ans)

### FIXED CODE ###

N = int(input())
count = 0

if N % 2 != 0:
    print(0)
    exit()
P = 1
k = 2 * 5

while k <= N:  
    count += N//k
    k *= 5
    
print(count)
# -*- coding: utf-8 -*-

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,q=map(int, io().split())
	s=list(io())
	
	ss=[0 for _ in s[:-1]]
	for i, (c, cn) in enumerate(zip(s, s[1:])):
		if c=='A' and cn=='C':
			ss[i]=1
	
	print(ss)
	ret=[]
	for i in range(q):
		r,l=map(int, io().split())
		rr=sum(ss[r-1:l])-ss[l-1]
		ret.append(str(rr))
		
	return "\n".join(ret)
	
	
#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	print (main(io))

### FIXED CODE ###

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

def io_generator():
	return input()

#+++++++++++++++++++

def main(io):
	n,q=map(int, io().split())
	s=list(io())
	
	ss=[0 for _ in s]
	sss=ss.copy()
	for i, c in enumerate(s[1:],1):
		if s[i-1]=='A' and s[i]=='C':
			ss[i]=1
		sss[i] = ss[i] + sss[i-1]
	
	for i in range(q):
		r, l=map(int, io().split())
		#rr=sum(ss[r-1:l])-ss[l-1]
		rr=sss[l-1]-sss[r-1]
		#ret.append(str(rr))
		print(rr)
	
#++++++++++++++++++++

if __name__ == "__main__":
	io= lambda : io_generator()
	#print (main(io))
	main(io)
print(eval('~-'+'*~-'.join(input().split()))

### FIXED CODE ###

a,b=map(lambda x:int(x)-1,input().split())
print(a*b)
class MyList(list):
    def __init__(self):
        self.__init__ = list

    def cmd(self,command):
        if command == 'deleteFirst':
            self.pop(0)
        elif command == 'deleteLast':
            self.pop(-1)
        else:
            ope, num = command.split()
            num = int(num)
            if ope == 'insert':
                self.insert(0,num)
            else:
                self.remove(num)


if __name__ == '__main__' :
    l = MyList()
    n = input()
    for i in range(n):
        l.cmd(raw_input())

    for i in range(len(l)-1):
        print l[i],
    print l[-1]

### FIXED CODE ###

from collections import deque

class MyList(deque):
    def __init__(self):
        self.__init__ = deque
        self.d = {'deleteFirst':self.delF, 'deleteLast':self.delL, 'insert':self.insX, 'delete':self.delX}
    def cmd(self,command):
        if ' ' in command:
            ope, num = command.split()
            num = int(num)
            self.d[ope](num)
        else:
            self.d[command]()
            
    def delF(self):
        self.popleft()

    def delL(self):
        self.pop()

    def insX(self,num):
        self.appendleft(num)

    def delX(self,num):
        if num in self:
            self.remove(num)

if __name__ == '__main__' :
    l = MyList()
    n = input()
    
    for i in range(n):
        l.cmd(raw_input())

    q = deque(l)
    for i in range(len(l)-1):
        print q.popleft(),
    print l[-1]
N,M = map(int,input().split())
sc = [list(map(int,input().split())) for i in range(M)]
c = [i[1] for i in sc]
s = [i[0] for i in sc]
smax = max(s)
sc2 = [-1 for i in range(smax)]
flag = False
for s1,c1 in sc:
    if sc2[s1-1] == -1:
        sc2[s1-1] = c1
    else:
        flag = True
        break
if -1 in sc2:
    num = 0
else:
    num = int(''.join(map(str,sc2)))
if smax > N or flag or num == 0:
    print(-1)
else:
    if N == 1:
        if num <= 9:
            print(num)
    else:
        rem = N-smax
        print(str(num) + '0'*rem)
        

### FIXED CODE ###

N,M = map(int,input().split())
sc = {}
flag = False
for i in range(M):
    s,c = map(int,input().split())
    if N!=1 and s==1 and c == 0:
        flag =True
        break
    elif s not in sc:
        sc[s] = c
    else:
        if sc[s] != c:
            flag = True
            break
if flag:
    print(-1)
elif N == 1 and M == 0:
    print(0)
else:
    if N == 1:
        print(sc[1])
    else:
        ans = [0 for i in range(N)]
        ans[0] = 1

        for s,c in sc.items():
            ans[s-1] = c
        print(*ans,sep='')
        print()
import math

a, b = map(int, input().split())
ans = a * b / math.gcd(a,b)
print(int(ans))

### FIXED CODE ###

import fractions

a, b = map(int, input().split())
ans = a * b / fractions.gcd(a,b)
print(int(ans))
N=int(input())
h=list(map(int,input().split()))
memo=[-1 for i in range(N)]
memo[0]=0
def dp(i):
    if memo[i]!=-1:
        return memo[i]
    cos=dp(i-1)+abs(h[i]-h[i-1])
    if i-2>=0:
        cos=min(cos,dp(i-2)+abs(h[i]-h[i-2]))
    memo[i]=cos
    return cos
print(dp(N-1))

### FIXED CODE ###

import sys
sys.setrecursionlimit(int(3e6))
N=int(input())
h=list(map(int,input().split()))

memo=[-1 for i in range(N)]
memo[0]=0
def dp(i):
    if memo[i]!=-1:
        return memo[i]
    cos=dp(i-1)+abs(h[i]-h[i-1])
    if i-2>=0:
        cos=min(cos,dp(i-2)+abs(h[i]-h[i-2]))
    memo[i]=cos
    return cos
print(dp(N-1))
N, M = map(int, input().split())
item_vote = list(map(int, input().split()))
total_vote = sum(item_vote)
item_vote = sorted(item_vote, reverse=True)
boder = total_vote/4*M
if item_vote[M-1] >= boder:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

X, Y, Z = map(int, input().split())
X, Y = Y, X
X, Z = Z, X
print(str(X)+' '+str(Y)+' '+str(Z))