peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
a,b=input().split()
a=int(a)
c,d=b.split(".")
c=int(c);d=int(d)
ans=a*(c*100+d)
print(ans//100)
# Judge status: Wrong Answer
"""
author : halo2halo
date : 2, Feb, 2020
"""

import sys
import itertools

import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

S = readline().decode('utf8')
vowel = 'aiueo'

print('vowel' if S in vowel else 'consonant')
# Judge status: Wrong Answer
from math import sqrt

x = int(input())

ans = int((sqrt(8*x+1))//2)

print(ans)
# Judge status: Accepted
k = int(input())
conditions = input().split(' ')
a = int(conditions[0])
b = int(conditions[1])

flag = False
for i in range(a, b+1):
    if i % k == 0:
        flag = True
        break

if flag:
    print('OK')
else:
    print('NG')
# Judge status: Accepted
import sys
input = sys.stdin.readline
LOCAL = len(sys.argv) > 1 and sys.argv[1] == 'LOCAL'


def dprint(*args):
  if LOCAL:
    print(*args)


MOD = 10**9 + 7

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

# https://note.nkmk.me/python-gcd-lcm/

import math
from functools import reduce
import fractions


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


def lcm(*numbers):
  return reduce(lcm_base, numbers, 1)


def lcm_list(numbers):
  return reduce(lcm_base, numbers, 1)


lcm = lcm_list(a)
dprint(lcm)

ans = 0
for x in a:
  ans += lcm // x
print(ans % MOD)
# Judge status: Wrong Answer
a = int()
A = a + a*a + a*a*a
print(A)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
b = sorted(a)
#print(a)
#print(b)
left = b[int(n/2)-1]
right = b[int(n/2)]
if left == right:
  for i in range(n):
    print(right)
else:
  for i in range(n):
    if a[i] <= left:
      print(right)
    else:
      print(left)
# Judge status: Wrong Answer
n = int(input())
for i in range(n):
  if i < 6:
    print(0)
  else:
    count=0
    for j in range(100):
      for k in range(100):
        for l in range(100):
          if ((j+1)**2 + (k+1)**2 + (l+1)**2 + (j+1)*(k+1) +(k+1)*(l+1) +(l+1)*(j+1)) == i:
            count +=1
    print(count)
# Judge status: Accepted
def sigma(n):
    return n * (n + 1) // 2

s = list(map(lambda x : 1 if x == '<' else -1, input()))
l = [s[0]]
for c in s[1:]:
    if c * l[-1] > 0:
        l[-1] += c
    else:
        l.append(c)
ans = 0
now = 0
for c in l:
    if c < 0:
        ans -= min(now, abs(c))
    ans += sigma(abs(c))
    now = abs(c)
print(ans)
# Judge status: Wrong Answer
N, M = map(int, input().split())
A = list(map(int, input().split()))
for _ in range(M):
  b, c = map(int, input().split())
  A.extend([c] * b)
  if len(A)>=2*N:
    break
A = sorted(A, reverse=True)
print(sum(A[:N]))
# Judge status: Accepted
a,b,h=[int(input()) for _ in range(3)];print((a+b)*h//2)
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
s = [Counter(input()) for _ in range(n)]

cnt = s[0]
for scnt in s:
    for str in (scnt | cnt):
        cnt[str] = min(cnt[str], scnt[str])

a = ord('a')
ans = [chr(a + i) * cnt[chr(a + i)] for i in range(25)]
print(*ans, sep='')
# Judge status: Accepted
N,K,Q = map(int,input().split())
A = [0]*Q
for i in range(Q): A[i]=int(input())-1
P = [K-Q]*N
for i in range(Q): P[A[i]]+=1
for i in range(N):
  if(P[i]>0): print("Yes")
  else: print("No")
# Judge status: Accepted
import itertools,sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
N,M = LI()
a = set([I() for _ in range(M)])
dp = [0]*(N+1) #1_indexed
dp[0] = 1
dp[1] = 0 if 1 in a else 1
for i in range(1,N+1):
    if i in a:
        dp[i] = 0
        continue
    if i-2>=0:
        dp[i] = (dp[i-1]+dp[i-2])%(10**9+7)
print(dp[-1])
# Judge status: Accepted
k = int(input())
a = 7
if a % k == 0:
  print(1)
  exit()
for i in range(k):
  a = (a * 10 + 7) % k
  if a == 0:
    print(i + 2)
    exit()
print(-1)
# Judge status: Wrong Answer
from math import*
A,B=sorted(map(int,input().split()))
prime=[]
i=1
while i**2<=A:
    if A%i==0:
        prime.append(i)
        prime.append(A//i)
    i+=1

prime=list(set(prime))
L=len(prime)
ans=[1]*L
j=1
while j<L:
    now=prime[j]
    if B%now:
        ans[j]=0
    k=j+1
    while k<L:
        if prime[k]%now==0:
            ans[k]=0
        k+=1
    j+=1

print(sum(ans))
# Judge status: Accepted
from collections import defaultdict

import sys
sys.setrecursionlimit(10**6)
ii = lambda: int(input())
mis = lambda: map(int,input().split())
lmis = lambda: list(mis())
INF = float('inf')

def main():
    n,m=mis()
    ans=n*m
    cnt=0
    if n>1:
        ans-=2*m
        cnt+=1
    if m>1:
        ans-=2*n
        cnt+=1
    if cnt==2: ans+=4
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
s=input()
t=input()
if s == t or s == t[::-1]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
alpha = 'ABCDEFGHIJKLMNOPQRSTUvWXYZ'
n = int(input())
s = input()
ans = ''
for x in s:
    ans += alpha[(alpha.find(x) + n) % 26]
print(ans)
# Judge status: Accepted
n, m, x = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]

min = float('inf')

for i in range(1<<n): # 1<<n == 2**n
    study = [0 for _ in range(m)]
    cost = 0

    for j in range(n):
        if i&(1<<j):
            cost += a[j][0]
            study = [study[k]+a[j][k+1] for k in range(m)]

    if(all([s >= x for s in study])):
        if min > cost:
            min = cost

if float('inf') > min:
    print(min)
else:
    print(-1)
# Judge status: Accepted
n = int(input())
s = input()

wn = s.count('.')
bn = n - wn
ans = min(wn,bn)

lw = 0
lb = 0
for i in range(n):
  if s[i]=='.':
    lw += 1
  else:
    lb += 1      
  ans = min(ans, lb + (wn - lw))
  
print(ans)
# Judge status: Wrong Answer
if len(set(input()))==1:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
X = list(map(int, input().split()))

for i, x in enumerate(X):
  if x == 0:
    print(i+1)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
for i in range(0, 100):
    if a > b or i == c:
        print(i)
        break
    b = b - a
# Judge status: Accepted
n = int(input())
s = input()

if n % 2 != 0:
  print('No')
else:
  if s[:int((n/2))] == s[int((n/2)):]:
    print('Yes')
  else:
    print('No')
# Judge status: Accepted
#B - Tag
A,V= map(int,input().split())
B,W= map(int,input().split())
T= int(input())

k = abs(B-A)
a = V*T
b = W*T



if a >= k + b:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
# 14　Square869120Contest #4 B - Buildings are Colorful!
import itertools
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in itertools.permutations(range(n)):
    for j in range(len(i)-1):
        ans += pow(pow(xy[i[j]][0]-xy[i[j+1]][0], 2) + pow(xy[i[j]][1]-xy[i[j+1]][1], 2), 0.5)
print(ans/(2*n))
# Judge status: Accepted
n, k = (int(x) for x in input().split())
a = 0
while True:
    if k ** a > n: break
    else: a += 1
if a == 0: a += 1
print(a)
# Judge status: Accepted
items = ['A', 'C', 'G', 'T']
 
def max(a, b):
    return a if a > b else b
x= 0
y = 0
for c in list(input()):
    if c in items:
 
        y += 1
        x = max(x, y)
    else:
        y = 0
print(x)
# Judge status: Accepted
A, B, C, X, Y = map(int, input().split())
all = A * X + B * Y
all_half = max(X, Y) * C * 2
m = min(X, Y)
appropriate_half = (m * C * 2) + A * (X - m) + B * (Y - m)
print(min(all, all_half, appropriate_half))
# Judge status: Wrong Answer
N, M = map(int, input().split())
ab = []
cd = []
for i in range(N):
  tmp = list(map(int, input().split()))
  ab.append(tmp)
for j in range(M):
  tmp = list(map(int, input().split()))
  cd.append(tmp)
tmp = 2*(10**8)+2
for i in range(N):
  tmp2 = 0
  for j in range(M):
    if tmp > abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1]):
      tmp = abs(ab[i][0]-cd[j][0])+abs(ab[i][1]-cd[j][1])
      tmp2 = j
  print(tmp2+1)
# Judge status: Accepted
a,b,c=map(int, input().split())
k = int(input())

for i in range(k):
    if a >= b:
        b = b*2
    elif b >= c:
        c = c*2
if a < b and b < c:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N = int(input())

if N % 2 == 1:
    print(0)
else:
    beki5 = 1
    sum0 = 0
    while 1:
        beki5 = beki5 * 5
        if beki5 > N:
            break
        else:
            sum0 += int(N/(beki5*2))
    print(sum0)
# Judge status: Wrong Answer
a = [int(i) for i in input().split()]
a[0], a[1] = a[1], a[0]
a[0], a[2] = a[2], a[0]
print(a)
# Judge status: Accepted
N, M = map(int, input().split())
a_li = [input() for i in range(N)]
b_li = [input() for i in range(M)]

for i in range(N - M + 1):
    for j in range(N - M + 1) :
        for k in range(M) :
            if a_li[i + k][j : j + M] != b_li[k] :
                break
            if k == M - 1:
                print("Yes")
                exit()
print("No")
# Judge status: Accepted
p,q,r = list(map(int,input().split()))
l = []
l+=[p,q,r]

l.sort()

l.pop()

print(sum(l))
# Judge status: Accepted
import math

n,d=map(int,input().split())
x=[]

for i in range(n):
  a=list(map(int,input().split()))
  x.append(a)

cnt=0

for i in range(n-1):
  for j in range(i+1,n):

    dis=0
    for k in range(d):
      dis+=(x[i][k]-x[j][k])*(x[i][k]-x[j][k])

    dis=math.sqrt(dis)
    if dis==int(dis):
      cnt+=1

print(cnt)
# Judge status: Accepted
K,S = map(int,input().split())
count = 0
for x in range(0,K+1):
  for y in range(0,K+1):
    if (S - (x + y) <= K and S - (x + y) >= 0):
      count += 1
print(str(count))
# Judge status: Accepted
n, t = map(int, input().split())
a = 10**19
for _ in range(n):
    c, tt = map(int, input().split())
    if t >= tt:
        a = min(c, a)
if a == 10**19:
    print('TLE')
else:
    print(a)
# Judge status: Accepted
N = int(input())
A_B = [list(map(int, input().split())) for _ in range(N)]
A_B.sort(key=lambda x: x[1])
count = 0
for i in range(N):
    if count + A_B[i][0] <= A_B[i][1]:
        count += A_B[i][0]
        continue
    print("No")
    break
else:
    print("Yes")
# Judge status: Accepted
s=input()
t=input()
ans=float('inf')

for i in range(len(s)-len(t)+1):
  x=s[i:i+len(t)]
  cnt=0
  for j in range(len(t)):
    if x[j]!=t[j]:
      cnt+=1
      
  ans=min(ans,cnt)
  
 
print(ans)
# Judge status: Accepted
#!/usr/bin/env python3
a, b, c = map(int, input().split())
k = int(input())
for _ in range(k):
    if a >= b:
        b *= 2
    elif b >= c:
        c *= 2
print(["No", "Yes"][a < b < c])
# Judge status: Accepted
A,B,C,K = map(int,input().split())

if K%2 == 0:
    print(A-B)
else:
    print(B-A)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
for i in range(n-2):
    if a[i]<0:
        a[i]*=-1
        a[i+1]*=-1
if a[-1]+a[-2]<0:
    a[-1]*=-1
    a[-2]*=-1
print(sum(a))
# Judge status: Accepted
from sys import stdin


def main():
    n = int(stdin.readline())
    a = map(int, stdin.readline().split())
    r = [0] * 13
    for ai in a:
        r[int(ai / 400)] += 1
    min = 0
    for i in range(8):
        if r[i] > 0:
            min += 1
    max = min
    for i in range(8, 13):
        max += r[i]
    if min == 0:
        min = 1
    print(min, max)


if __name__ == "__main__":
    main()
# Judge status: Accepted
a,b = map(int,input().split())
c = (b-1)//(a-1)
if (b-1)%(a-1) == 0:
  print(c)
else:
  print(c+1)
# Judge status: Accepted
def main():
    N = int(input())
    c = [[0 for i in range(10)] for j in range(10)]
    for k in range(1, N+1):
        s = str(k)
        c[int(s[0])][int(s[-1])] += 1

    ans = 0
    for i in range(10):
        for j in range(10):
            ans += c[i][j] * c[j][i]
    print(ans)


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
pl = list(map(int, input().split()))

num_l = []
for i in range(n-2):
    if pl[i] < pl[i+1] < pl[i+2] or pl[i] > pl[i+1] > pl[i+2]:
        num_l.append(pl[i+1])

print(len(set(num_l)))
# Judge status: Accepted
N, K = map(int, input().split())
d = []
A = []

for k in range(K):
    d.append(int(input()))
    A.append(list(map(int, input().split())))

Alist = [e for row in A for e in row]
        
L = len(list(set(Alist)))
print(N-L)
# Judge status: Accepted
N,M=map(int,input().split())
abs_NM=abs(N-M)
if abs_NM>1:
    print(0)
    exit()

p=10**9+7
ans=1
for i in range(1,N+1):
    ans=(ans*i)%p
for i in range(1,M+1):
    ans=(ans*i)%p
if abs_NM==0:
    ans=(ans*2)%p

print(ans)
# Judge status: Wrong Answer
n = int(input())
li1 = 1
li2 = 2
luca = 0
for i in range(n-1):
    luca = li1 + li2
    li2 = li1
    li1 = luca
print(luca)
# Judge status: Accepted
N=int(input())
from collections import deque

q=deque([9,8,7,6,5,4,3,2,1])

for i in range(N-1):
  num=q.pop()
  if num%10!=0:
    q.appendleft(num*10+num%10-1)
  q.appendleft(num*10+num%10)
  if num%10!=9:
    q.appendleft(num*10+num%10+1)

print(q.pop())
# Judge status: Wrong Answer
N,C,K = map(int,input().split())
li = []
for t in range(N):
  li.append(int(input()))

count = 0
ans = 0

newLi = sorted(li)

while(len(newLi)):
  k = newLi[0]

  for c in range(C - 1):
    if len(newLi) < c + 2:
      continue
    
    if newLi[c + 1] <= k + K:
      newLi.pop(c + 1)

  newLi.pop(0)
  ans += 1

print(ans)
# Judge status: Accepted
s=str(input())
a="Y"
b="Y"
if 0<int(s[0:2])<13:
    a="MY"
if 0<int(s[2:5])<13:
    b="MY"

if a==b=="Y":
    ans="NA"
elif a=="Y" and b=="MY":
    ans="YYMM"
elif a=="MY" and b=="Y":
    ans="MMYY"
else:
    ans="AMBIGUOUS"
print(ans)
# Judge status: Accepted
a,b,k = map(int,input().split())

count = 0
for i in reversed(range(1,min(a,b)+1)):
	if a % i == 0 and b % i == 0:
		count += 1
	if count == k:
		break
print(i)
# Judge status: Wrong Answer
n, m = map(int, input().split())
print((n + 1) * (m // 2 + 1))
# Judge status: Wrong Answer
n, k = list(map(int, input().split()))
a = list(map(int, input().split()))

i = a.index(1)

s = n

for j in range(i-k+1, i+k):
    if j < 0:
        continue
    elif j >= n:
        continue
    else:
        l = j
        u = (n-1-j)
        t = (l+1) // (k-1) + (u+1) // (k-1)
        #print(t)
        s = min(s, t)

print(s)
# Judge status: Accepted
"""
"""
n,x,y=map(int,input().split())
ret=[0]*(n-1)
for i in range(1,n):
    for j in range(i+1,n+1):
        ret[min(j-i,abs(x-i)+1+abs(y-j),abs(x-j)+1+abs(y-i))-1]+=1
for r in ret:
    print(r)
# Judge status: Accepted
s = int(input())
checked = [s,]
for i in range(10**7):
    if checked[i] % 2 == 0:
        a_i = checked[i] // 2
    else:
        a_i = 3 * checked[i] + 1
    if a_i in checked:
        print(i+2)
        break
    checked.append(a_i)
#print(checked)
# Judge status: Accepted
x=int(input())
ans=0
d,m=divmod(x,11)
ans+=d*2
ans+=1 if m else 0
ans+=1 if m > 6 else 0
print(ans)
# Judge status: Wrong Answer
N, M = map(int,input().split())
for i in range(1, N+1):
    # 足の数
    f = 2 * i + 4 * (N - i)
    if f == M:
        print("Yes")
        break
else:
    print("No")
# Judge status: Accepted
def f(n):
    if n % 2 == 0:
        return int(n / 2)
    else:
        return 3 * n + 1

def solve_B():
    s = int(input())
    list = [0] * 1000000
    list[s] += 1
    for i in range(2, 1000000):
        x = f(s)
        if list[x] == 1:
            return i
        list[x] += 1
        s = x

print(int(solve_B()))
# Judge status: Accepted
for i,w in enumerate(l:=[input() for _ in range(int(input()))]):
  if i and (l[i][0]!=l[i-1][-1] or w in l[:i]): exit(print('No'))
print('Yes')
# Judge status: Wrong Answer
n=int(input())
a=[int(x) for x in input().split()]
mx=max(a)
rem=sum(a)-mx
if mx > rem:
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n = int(input())
s = list(map(int,input().split()))
un = 0
un_1 = 0


while un < n-1:
  s.sort()
  sign = 0
  for i in range(un_1,n):
    if s[i] == 0:
      un = i+1
      continue

    if i == un:
      continue
    
    temp = s[i] - (s[i]//s[un])*s[un]
    
    if 0 <= temp:
      s[i] = temp
    elif temp < 0:
      s[i] = 0
    
  un_1 = un
    
print(s[un])
# Judge status: Wrong Answer
def myAnswer(K:int,A:int,B:int) -> int:
   if((B - A) > A):
      counter = (K - (A - 1)) // 2
      total = (counter * B) - (counter * A) + A
      # print(counter,total)
      if(K - (A - 1)) % 2 == 1:
         total += 1
   else:
      total = K + 1
   return total

def modelAnswer():
   return
def main():
   K,A,B = map(int,input().split())
   print(myAnswer(K,A,B))
if __name__ == '__main__':
   main()
# Judge status: Wrong Answer
# -*- coding: utf-8 -*-
N, M = map(int, input().split())
L = []
R = []
for i in range(M):
    l, r= map(int, input().split())
    L.append(l)
    R.append(r)
Lmax = max(L)
Rmax = min(R)
print(Rmax-Lmax+1)
# Judge status: Accepted
def my_round(x, d=0):
    import math
    p = 10 ** d
    return float(math.floor((x * p) + math.copysign(0.5, x)))/p

def resolve():
    import statistics
    n = int(input())
    x = [int(i) for i in input().split()]
    median = my_round(statistics.mean(x))
    res = sum([(i-median)**2 for i in x])
    print(int(res))
    
resolve()
# Judge status: Accepted
MAX = 10**9

N, K, S = map(int, input().split())
if S == MAX:
    MAX = 1
A = [S]*K + [MAX]*(N-K)
print(*A)
# Judge status: Accepted
from collections import Counter

n = int(input())
a = map(int, input().split())
c = Counter(a)

ans = max(c[k]+c[k+1]+c[k-1] for k in c.keys())
print(ans)
# Judge status: Accepted
h,n = map(int,input().split())

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

if h <= sum(a):
    print("Yes")
else:
    print("No")
# Judge status: Accepted
a,b = map(int, input().split())
b2 = sum(range(1,b-a+1))
print(b2-b)
# Judge status: Accepted
N, K, S = map(int, input().split())
v = 10**9 if S!=10**9 else 1
l = [S] * K + [v] * (N-K)
print(*l)
# Judge status: Wrong Answer
import sys

N = int(input())
A = list(map(int, sys.stdin.readline().rsplit()))

pre = 300
money = 1000
num = 0

for i, a in enumerate(A):
    if a < pre and not all([a > aa for aa in A[i + 1:]]):
        pre = a
        num = money // a
        money %= a
    elif a > pre:
        pre = a
        money += num * a
        num = 0

print(money + num * A[-1])
# Judge status: Accepted
S = list(input())
T = list(input())
ans=0
for i in range(len(S)):
  if S[i]!=T[i]:
    ans+=1

print(ans)
# Judge status: Wrong Answer
N,Y=map(int,input().split())
for i in range(N+1):
  for k in range(N+1-i):
    m = N-i-k
    if 10000*i + 5000*k + 1000*m == Y:
      print(i,k,m)
      exit()
print('-1' '-1' '-1')
# Judge status: Accepted
n = int(input())
S = [input() for _ in range(n)]

d = {chr(i): 50 for i in range(97, 97+26)}
for s in S:
    dcur = {chr(i): 0 for i in range(97, 97+26)}
    for si in s:
        dcur[si] += 1
    for k in d:
        d[k] = min(d[k], dcur[k])

ks = list(d.keys())
ks.sort()

ans = []

for k in ks:
    ans.extend([k] * d[k])

print(''.join(ans))
# Judge status: Accepted
s=input()
l=len(s)
ans=0
for i in range(l//2):
  if s[i]!=s[-(i+1)]:
    ans+=1
print(ans)
# Judge status: Accepted
import math


def is_prime(n):
    if n == 1:
        return False

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return False

    return True


x = int(input())
while (1):
    if is_prime(x):
        print(x)
        exit()
    else:
        if x % 2 == 0:
            x += 1
        else:
            x += 2
# Judge status: Accepted
import sys
input = sys.stdin.readline

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

idx = a.index(1)

left = idx
right = n - (idx + 1)

ans = 10 ** 10

for i in range(k):
    cnt = 1
    left_ = left - i
    right_ = right - (k - 1 - i)
    cnt += left_//(k - 1) + right_//(k - 1) + int(not left_ % (k - 1) == 0) + int(not right_ % (k - 1) == 0)
    ans = min(ans, cnt)

print(ans)
# Judge status: Wrong Answer
n = int(input())
a = [int(i) for i in input().split()]
ans = 0
for i in range(n):
  ans += a[i*2+1]
print(ans)
# Judge status: Accepted
k, x = map(int, input().split())

min_n = x - k + 1
max_n = x + k - 1

for i in range(min_n, max_n+1):
    print(i)
# Judge status: Accepted
import sys
input = sys.stdin.readline
inf = 10**9
H, N = map(int, input().split())
AB = []
for n in range(N):
    a, b = map(int, input().split())
    AB.append((a, b))
AB.sort(reverse=True, key=lambda x: x[0])
dp = [inf] * (H + 10 ** 4)
dp[0] = 0
for a, b in AB:
    for h in range(H):
        if dp[h] != inf:
            tmp = dp[h] + b
            if tmp < dp[h + a]:
                dp[h + a] = tmp
print(min(dp[H:]))
# Judge status: Wrong Answer
N = int(input())
A = list(map(int, input().split()))

tmp = [0 for i in range(N+1)]
length = 0
for i in range(N):
  tmp[i+1] = tmp[i] + A[i]
  length += A[i]
  
ans = 10 ** 10
for i in range(1, N+1):
 ans = min(ans, abs(length - tmp[i]))

print(ans)
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
L=1
ans=0
for i in range(N):
  if A[i]!=L:
    ans+=1
  else:
    L+=1

if N==1 and A[0]==1:
  print(0)
elif 1 not in A:
  print(-1)
else:
  print(ans)
# Judge status: Wrong Answer
A, B, C, D = map(int, input().split())

if A==C:
    print(min(B-A,D-C))

elif A<C:
    if B>=D:
        print(D-C)
    elif B<=D:
        print(B-C)

else:
    if D>=B:
        print(B-A)

    elif D<=B:
        print(D-A)
# Judge status: Accepted
a,b = map(int,input().split())
if a/0.08 == a//0.08:
    emin = a//0.08
else:
    emin = a//0.08+1
if (a+1)/0.08 == (a+1)//0.08:
    emax = (a+1)//0.08-1
else:
    emax = (a+1)//0.08
tmin = b/0.1
tmax = (b+1)/0.1-1
if tmax >= emax:
    if tmin <= emax:
        print(int(tmin))
    else:
        print(-1)
else:
    if emin <= tmax:
        print(int(emin))
    else:
        print(-1)
# Judge status: Wrong Answer
H = int(input())
#print(H)
# Hが2^Nのどこに該当するかを判定する*これが難しいかも。。
#H = H//2
# それがわかれば、2^N + 2^N-1 + 2^N-2 + .... 2^0の合計がわかるので、それが答え。
#print(H)
l = []
# 数学としてはわかるけれど、pythonとしてわからないというか。。

while H > 0:
  l.append(H)
  H = H//2
print(sum(l))
# Judge status: Accepted
x,y = map(int,input().split())
if abs(x) == abs(y):
  print(1)
  exit()
if x*y > 0:
  if x < y:
    print(y-x)
  else:
    print(x-y+2)
elif x*y < 0:
  print(abs(abs(x)-abs(y))+1)
else:
  if x < y:
    print(y-x)
  else:
    print(abs(x+y)+1)
# Judge status: Accepted
H,N=map(int,input().split())
A,B=[],[]
for i in range(N):
    a,b=map(int,input().split())
    A.append(a)
    B.append(b)


INF=10**9
dp=[INF for i in range(H+max(A))]
dp[0]=0

for i in range(H):
    for j in range(N):
        p1=dp[i+A[j]]
        p2=dp[i]+B[j]
        dp[i+A[j]]=min(p1,p2)

print(min(dp[H:]))
# Judge status: Accepted
import sys
from math import ceil

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())

sys.setrecursionlimit(10 ** 9)


def main():
    K = INT()
    print((K//2)*ceil(K/2))


if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B = map(int, input().split())
print(max(A, B) + max(max(A,B)-1, min(A,B)))
# Judge status: Accepted
n = int(input())
l = list(map(int, input().split()))

i = 0
ans = 0
while i < n:
    j = i
    while j < n-1 and l[j] >= l[j+1]:
        j += 1
    k = i
    while k < n-1 and l[k] <= l[k+1]:
        k += 1
    i = max(j, k) + 1
    ans += 1
    #print(j, k)

print(ans)
# Judge status: Accepted
N = int(input())
memo = [2,1]
for i in range(2,N+1):
    memo.append(memo[i-1]+memo[i-2])
print(memo[-1])
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np

n = int(readline())
a = np.array(readline().split(), dtype=np.int32)
b = np.array(readline().split(), dtype=np.int32)
c = -np.array(readline().split(), dtype=np.int32)

a.sort()
b.sort()
c.sort()

cnt_a=np.searchsorted(a,b)
cnt_c=np.searchsorted(c,-b)
print((cnt_a*cnt_c).sum())
# Judge status: Accepted
p, q, r = map(int, input().split())
print(p + q + r - max(p, q, r))
# Judge status: Accepted
i=input;print(['NO','YES'][int(i())==len(set(i().split()))])
# Judge status: Accepted
import sys
input = sys.stdin.buffer.readline

def main():
    N,A,B = map(int,input().split())
    
    if (B-A)%2 == 0:
        print((B-A)//2)
    else:
        print(min((A+B-1)//2,(2*N+1-A-B)//2))
    
if __name__ == "__main__":
    main()
# Judge status: Accepted
d,t,s = map(int, input().split())
print("Yes" if t*s >= d else "No")
# Judge status: Wrong Answer
N = str(input())
if N in "9":
  print("Yes")
else:
  print("No")