peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

SA = sum(A)
SB = sum(B)

cnt_a, cnt_b = 0, 0
for i in range(N):
  if A[i] <= B[i]:
    cnt_a += (B[i] - A[i] + 1)//2
  else:
    cnt_b += A[i] - B[i]

if SB - SA >= max(cnt_a, cnt_b):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
r = range(1, 10)
n = int(input())
a = [None] + [[0] * 10 for _ in r]
for i in r:
  if i <= n:
    a[i][i] += 1
for i in r:
  for j in r:
    k = 1
    while 10 * k * i + j <= n:
      a[i][j] += min(k, (n - j) // 10 - k * i + 1)
      k *= 10
print(sum(a[i][j] * a[j][i] for i in r for j in r))
# Judge status: Accepted
import sys
import math
import numpy as np
stdin = sys.stdin
mod = 10**9 + 7

ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
sa = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

a = []
for _ in range(5):
    a.append(ni())
a = np.array(a)

m = np.min((a-1)%10+1)
d = (a - 1) // 10 + 1
print(sum(d)*10 + m - 10)
# Judge status: Accepted
a, b = input().rstrip().split()
v = int(a + b)

li = [i**2 for i in range(v//2)]

if v in li:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n = [input() for i in range(2)]

k = int(n[0])
s = n[1]

if len(s) <= k:
    print(s)

else:
    s = s[0:k] + "..."
    print(s)
# Judge status: Accepted
N, x = map(int, input().split())
A = list(map(int, input().split()))

ans = 0

for index, a in enumerate(A):
  if index == 0:
    if a > x:
      ans += abs(x - a)
      A[index] = x
    continue

  if a + A[index-1] > x:
    ans += abs(x - (a + A[index-1]))
    A[index] = x - A[index-1]

print(ans)
# Judge status: Wrong Answer
def division(li):
    for i in range(len(li)):
        if i % 2 == True:
            continue
        else:
            print(i)

division([8, 12, 40])
# Judge status: Accepted
n = int(input())

d = 2
ans = 0

while d * d <= n:
    if n % d != 0:
        d += 1
        continue

    z = d
    while n % z == 0:
        n //= z
        z *= d
        ans += 1

    while n % d == 0:
        n //= d

if n != 1:
    ans += 1

print(ans)
# Judge status: Accepted
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())
if (v - w) * t >= abs(a - b):
    print("YES")
else:
    print("NO")
# Judge status: Accepted
import sys

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

for i in range (0,N-1):
  if A[i] == A[i+1]:
    print("NO")
    sys.exit()
print("YES")
# Judge status: Accepted
N, x = input().split(' ')
N = int(N)
x = int(x)
a = input().split(' ')
a = [int(a[i]) for i in range(N)]
a = sorted(a)
count = 0
for i in range(N):
  if x - a[i] < 0:
    x -= a[i]
    break
  else:
    x -= a[i]
    count += 1
if x > 0:
  count -= 1

print(count)
# Judge status: Wrong Answer
import numpy as np
h,n=map(int,input().split())
a=np.empty((3,n))
for i in range(n):
  aa,bb=map(int,input().split())
  a[0,i]=aa
  a[1,i]=bb
  a[2,i]=aa/bb
a=a[:,np.argsort(a[2,:])[::-1]]
c=0
while h>0:
  for i in range(n):
    if a[0,i]<h or a[0,i]==a[0].min():
    	h-=a[0,i]
    	c+=a[1,i]
    	break
print(int(c))
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = "APPROVED"

for n in range(N):
    if A[n] % 2 == 1:
        pass
    elif A[n] % 3 == 0:
        pass
    elif A[n] % 5 == 0:
        pass
    else:
        ans = "DENIED"
        break
print(ans)
# Judge status: Accepted
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    a, b, c = map(int, readline().split())

    if b - a == c - b:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    main()
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())
if A < B:
    A += V*T
    B += W*T
    print("YES" if A >= B else "NO")
else:
    A -= V*T
    B -= W*T
    print("YES" if A <= B else "NO")
# Judge status: Wrong Answer
a,b = input().split()
c = a+b
c = int(c)
for i in range (1,101):
  if i**2 == c:
    print("Yes")
    exit()
print("No")
# Judge status: Accepted
from collections import deque

N, M = map(int, input().split())
AB = [map(int, input().split()) for _ in range(M)]

links = [[] for _ in range(N + 1)]
for a, b in AB:
    links[a].append(b)
    links[b].append(a)

result = [-1] * (N + 1)
q = deque([1])
while q:
    i = q.popleft()
    for j in links[i]:
        if result[j] == -1:
            result[j] = i
            q.append(j)
print('Yes')
print('\n'.join(str(i) for i in result[2:]))
# Judge status: Accepted
# -*- coding: utf-8 -*-
s = list(input())

ans = []
for i in s:
    if len(ans) > 0 and i == 'B':
        ans.pop()
    if i == '0':
        ans.append('0')
    if i == '1':
        ans.append('1')
print(''.join(ans))
# Judge status: Accepted
n=int(input())
ans=[]
a=[]
b=[]
c=[]
d=[]
for i in range(n):
    x,y=map(int,input().split())
    a.append(x-y)
    b.append(x+y)
a=sorted(a)
b=sorted(b)
ans=[a[-1]-a[0],b[-1]-b[0]]
print(max(ans))
# Judge status: Accepted
A,B,C = sorted(map(int,input().split()))
D = 2*C-A-B

if D%2==0:
  print(D//2)
else:
  print((D+3)//2)
# Judge status: Accepted
import numpy as np

N = int(input())
A = np.array([int(x) for x in input().split()])

ans=0
for i in range(61):
  B = (A >> i) & 1
  x = np.count_nonzero(B == 0)
  y = N - x
  ans += (x*y*(2**i))%(10**9+7)
  
print(ans%(10**9+7))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
def main():
    A, B, C = map(int, input().split())
    K = int(input())
    for i in range(K):
        if A < B:
            break
        B *= 2
    K -= i
    for i in range(K):
        if B < C:
            break
        C *= 2
    if A < B and B < C:
        print('Yes')
    else:
        print('No')

if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
prices = []
total_fruits = 0
max_numb = 0

total_fruits, max_numb = input().split(' ')
tmp_prices = input().split(' ')
tmp_prices.sort()
ans = 0
for i in range(int(max_numb)):
  ans += int(tmp_prices[i])
  
print(ans)
# Judge status: Accepted
a,b,c,k = (int(x) for x in input().split())
import sys 

if a >= k:
    print(k * 1)
    sys.exit()
elif k > a:
    if a + b >= k:
        print(a * 1)
        sys.exit()
    elif k > a + b:
        print(a * 1 + (k - a - b)* -1)
        sys.exit()
# Judge status: Wrong Answer
n = int( input() )
l = list( map( int, input().split() ) )

l = sorted( l )
cnt = 0
for i in range( len( l ) - 2 ):
  for j in range( i + 1, len( l ) - 1 ):
    for k in range( j + 1, len( l ) ):
      if l[ i ] + l[ j ] <= l[ k ]:
        break
      else:
        print( l[ i ], l[ j ], l[ k ] )
        cnt += 1
print( cnt )
# Judge status: Accepted
N, K = input().split()
N = int(N)
K = int(K)
a = input().split()
A = [int(u) for u in a]
for i in range(0, N):
	if i >= K:
		if A[i] > A[i - K]:
			print("Yes")
		else:
			print("No")
# Judge status: Accepted
vowel = 'aeiou'
c = input()

if c in vowel:
    print('vowel')
else:
    print('consonant')
# Judge status: Wrong Answer
import sys
INF = 1e9 + 5
def solve(n, k, ls):
	dp=[10**5 for i in range(n)]
	dp[0]=0
	for i in range(n):
		for j in range(1,k+1):
			if (i+j<n):
				dp[i+j]=min(dp[i+j],dp[i]+abs(ls[i+j]-ls[i]))
	return(dp[n-1])  
 
if __name__ == "__main__":
    f = sys.stdin
    fo = sys.stdout
    n, k = map(int, f.readline().split())
    arr = list(map(int, f.readline().split()))
    result = solve(n, k, arr)
    print(result)
# Judge status: Wrong Answer
a, b ,c ,d = map(int, input().split())
print((b - a) - (b / c - a / c) + (b / d - a / d) - (b / (c * d) - a / (c * d)))
# Judge status: Accepted
S = input()
ls = []
check = True
for i in range(len(S)):
  if S[i] in ls:
    check = False
    break
  ls.append(S[i])
  
print("yes" if check else "no")
# Judge status: Wrong Answer
s=input()

n=len(s)

from collections import Counter

c =Counter(s).values()

zero_flg =0
for i in c:
    if i==0:
        zero_flg+=1

if zero_flg!=0:
    print('NO')
    exit(0)
else:
    print('YES')
# Judge status: Accepted
n, k = map(int, input().split())
d = []
A = [A for A in range(1, n+1)]
ans = []
for i in range(k):
  d.append(int(input()))
  al = list(map(int, input().split()))
  for j in range(len(al)):
    if not(al[j] in ans):
      ans.append(al[j])
print(len(list(set(A)-set(ans))))
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))

f=''
ans=1
for i in range(1,n):
    if a[i-1]==a[i]:
        continue
    if a[i-1] < a[i]:
        if f=='>':
            ans+=1
            f=''
        else:
            f='<'
    else:
        if f=='<':
            ans+=1
            f=''
        else:
            f='>'
print(ans)
# Judge status: Accepted
def main():
    n = input()
    if n[-1] in '24579':
        print('hon')
    elif n[-1] in '0168':
        print('pon')
    elif n[-1] in '3':
        print('bon')

if __name__ == "__main__":
    main()
# Judge status: Accepted
s = input()
print(''.join(['x' for _ in range(len(s))]))
# Judge status: Wrong Answer
n,m = map(int,input().split())
a = [int(input()) for i in range(m)]
mod = 1000000007
lis = []
if m == 0:
  print(0)
  exit()
  
if 1 not in a:
  lis.append(1)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(2)
    
elif 1 in a:
  lis.append(0)
  if 2 in a:
    lis.append(0)
  else:
    lis.append(1)


for i in range(3,n+1):
  if i in a:
    lis.append(0)
  else:
    lis.append((lis[i-2] + lis[i-3])%mod)
    
print(lis[-1])
# Judge status: Accepted
import sys

N = list(map(int, sys.stdin))
bot = N[1]

for i in range(N[0]):
    if bot == 2:
        print(i+1)
        break
    bot = N[bot]
else:
    print(-1)
# Judge status: Wrong Answer
from math import log2

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    X, Y = mi()
    print(int(log2(Y)-log2(X))+1)
    


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = list(map(int, reversed(list(input()))))
a , b = 0, 9999
for x in n:
    a, b = min(a+x, b+x), min(a+10-x+1, b+10-x-1)
print(min(a, b))
# Judge status: Accepted
n = int(input())
s = input()

res = 1 << 40
num_black = 0
num_white = s.count('.')
for i in range(n):
    res = min(res, num_black + num_white)
    if s[i] == '.':
        num_white -= 1
    else:
        num_black += 1
        
res = min(res, num_black + num_white)
print(res)
# Judge status: Wrong Answer
n = int(input())
print(n*800-n/15*200)
# Judge status: Wrong Answer
def divisor(x):
    ret = []
    for i in range(1, int(x ** 0.5) + 1):
        if x % i == 0:
            ret.append(i)
            ret.append(x // i)
    return list(set(ret))

n = int(input())

div = divisor(n)[1:]

ans=0
for i in div:
    if n % i == 0:
        ans += 1
        n //= i

print(ans)
# Judge status: Accepted
s, w = list(map(int, input().split()))
if s > w:
    print("safe")
else:
    print("unsafe")
# Judge status: Accepted
a,b,c,x = map(int,[input() for i in range(4)])
ans = 0
for i in range(a+1):
  for j in range(b+1):
    for f in range(c+1):
      if i*500 + j*100 + f*50 == x:
        ans +=1
            
print(ans)
# Judge status: Wrong Answer
#N = int(input())
a = list(map(int,input().split()))
#xor_a = [bin(x) for x in a]
#print(xor_a)
#sum_xor = bin(sum(a))
b = [sum(a) ^ a[x] for x in range(len(a))]
print(b)
# Judge status: Accepted
n = int(input())
L = []
last_letter = 0
for i in range(n):
    w = str(input())
    L.append(w)
    if (i != 0 and w[0] != last_letter) or L.count(w) != 1:
        print('No')
        exit()
    last_letter = w[-1]
print('Yes')
# Judge status: Accepted
from bisect import bisect_left
N = int(input())
a = list(map(int,input().split()))
a.sort()
x = a[-1]
i = bisect_left(a, x/2, hi=N-2)
for j in [i-1, i, i+1]:
    if 0 <= j < N and abs(a[j]-x/2) < abs(a[i]-x/2):
        i = j
print(x, a[i])
# Judge status: Accepted
#input
N, K = map(int, input().split())

#output
mod = pow(10, 9) + 7
answer = 0
for i in range(K, N+2):
    answer += ((N*(N+1)//2)  - ((N-i)*(N-i+1)//2) - (i*(i-1)//2) + 1) % mod

print(answer % mod)
# Judge status: Accepted
N, A, B, C, D = map(int, input().split())
S = "#" + input() + "#"

# twoblock = S[A:].count("##")


def twoblock(start, end):
    return S[start : end + 1].count("##")


tripledot = S[B - 1 : D + 2].count("...")

if twoblock(A, C) or twoblock(B, D):
    print("No")
    exit()

if C > D:
    if tripledot == 0:
        print("No")
        exit()

print("Yes")
# Judge status: Accepted
N, A, B = map(int, input().split())
print(0 if (N == 1 and A != B) or A > B else (A + B * (N - 1)) - (A * (N - 1) + B) + 1)
# Judge status: Wrong Answer
def f(s):
    if s==".":
        return 1
    else:
        return 0

N,M=map(int,input().split())
A=[]
for _ in range(N):
    A.append(list(map(f,input())))

B=[]
for _ in range(M):
    B.append(list(map(f,input())))

F=False
for i in range(N-M+1):
    for j in range(N-M+1):
        G=True
        for k in range(M):
            G=G and (A[j+k][i:i+M]==B[k])

if G:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
s = input()

if s[1:].count("9") == len(s)-1:
    print(9*(len(s)-1)+int(s[0]))
else:
    print(9*(len(s)-1)+int(s[0])-1)
# Judge status: Accepted
n = int(input())

w = list(map(int,input().split()))
count = 0
min = 1000
for t in range(1,n):
  count =  abs(sum(w[:t]) - sum(w[t:n])) 
  if count < min:
    min = count
print(min)
# Judge status: Accepted
import sys; input = sys.stdin.buffer.readline
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

#処理内容
def main():
	N, K = getlist()
	D = defaultdict(int)
	for i in range(K):
		d = int(input())
		A = getlist()
		for j in A:
			D[j] += 1

	ans = N - len(D)
	print(ans)

if __name__ == '__main__':
	main()
# Judge status: Accepted
k = int(input())
n = 0
for i in range(10**6 + 1):
    n += 7 * pow(10, i, k)
    n %= k
    if n % k == 0:
        print(i+1)
        exit()

print(-1)
# Judge status: Accepted
a = int(input())
s = input()
if a >= 3200:
 	print (s)
else:
   print("red")
# Judge status: Accepted
from sys import stdin,stdout

def main():
    line=stdin.readline()
    parts=line.split()
    a=int(parts[0])
    b = int(parts[1])
    if b>=a:
        stdout.write(str(a))
    else:
        stdout.write(str(a-1))
main()
# Judge status: Wrong Answer
d, n = map(int, input().split())

ans = 100**d * (n)
if n==100:
    ans+=1

print(ans)
# Judge status: Wrong Answer
a,b,c=map(int,raw_input().split())
if a+b>=c:
  print "yes"
else:
  print "no"
# Judge status: Wrong Answer
n = int(input())
ans = 1000 - n % 1000
print(ans)
# Judge status: Accepted
S=input()
if S[0]==S[1] and S[2]==S[3] and S[0]!=S[2]:
    print("Yes")
elif S[0]==S[2] and S[1]==S[3] and S[0]!=S[1]:
    print("Yes")
elif S[0]==S[3] and S[1]==S[2] and S[0]!=S[1]:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    
    n,k=map(int,input().split())
    ans=0
    for i in range(1,n):
        cnt=0
        while i<k:
            i*=2
            cnt+=1
        ans+=(1/n)*(1/2**cnt)
    print(ans)

    
resolve()
# Judge status: Accepted
s = list(input())
a = 0
for i in range(len(s)):
  if i%2 == 0 and s[i] == 'L':
    a += 1
    print('No')
    break
  elif i%2 != 0 and s[i] == 'R':
    a += 1
    print('No')
    break
      
if a == 0:
  print('Yes')
# Judge status: Wrong Answer
n,x,t=map(int,input().split())
for i in range(1,t):
  if x*i>=n:
    print(i*t)
    break
# Judge status: Accepted
N = int(input())
Ans = 0
 
for i in range(1, N+1, 2):
    count = 0
    for j in range(1, i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        Ans += 1
 
print(Ans)
# Judge status: Accepted
n = int(input())
b = list(map(int, input().split()))

s = b[0] + b[-1]
for i in range(n-2):
    s += min(b[i], b[i+1])

print(s)
# Judge status: Wrong Answer
def resolve():
    '''
    code here
    '''
    A, B, C, K = [int(item) for item in input().split()]

    if K % 2 == 0:
        res = B - A
    else:
        res = A -B


    print(A-B)
if __name__ == "__main__":
    resolve()
# Judge status: Accepted
N = int(input())
ans = 1
for i in range(N):
  ans *= i + 1
  ans %= 10**9 + 7
  
print(ans)
# Judge status: Wrong Answer
n=int(input())
a=list(map(int,input().split()))
a.sort(reverse=True)
Ali,Bob=0,0
for i in range(0,n-1,2):
    Ali +=a[i]
    Bob +=a[i+1]
print(Ali-Bob)
# Judge status: Wrong Answer
n = int(input())
c = "No"
for i in range(1,9):
    if n % i == 0 and n // i < 10:
        c = "Yes"
        break

print(c)
# Judge status: Accepted
S = int(input())
ans = [0, 0, 10 ** 9, 1]
x = (10 ** 9 - S % 10 ** 9) % 10 ** 9
y = (S + x) // 10 ** 9
ans.append(x)
ans.append(y)
print(*ans)
# Judge status: Wrong Answer
r, g, b = map(int, input().split())
print('Yes' if (10 * g + b) % 4 == 0 else 'N0')
# Judge status: Accepted
import heapq

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

an = [-1 * i for i in an]

heapq.heapify(an)

for _ in range(m):
    x = heapq.heappop(an)
    x = int(x/2)
    heapq.heappush(an, x)

print(-1 * sum(an))
# Judge status: Accepted
X=int(input())
S=[0]*10**6
goukei=0
for i in range(10**6):
    goukei+=i
    S[i]=goukei
    
for i in range(10**6):
    if X<=S[i]:
        print(i)
        exit()
    
#print(S[(10**6)-1])
# Judge status: Accepted
N,M = list(map(int,input().split()))
a = [int(input()) for i in range(M)]
a_complement = list((set(list(range(N+1))) ^ set(a)))
cnt = {s: 0 for s in range(-2,N+1)}
cnt[0] = 1

for i in a_complement:
  cnt[i] += cnt[i-1] + cnt[i-2]

print(cnt[N] % 1000000007)
# Judge status: Accepted
n, m = map(int, input().split())
if 2*n <= m:
  print(n + (m-2*n)//4)
else:
  print(m//2)
# Judge status: Accepted
N = int(input())


for i in range(N+1):
    X = i * 1.08
    if int(X) == N:
        print(i)
        exit()

print(':(')
# Judge status: Wrong Answer
N = int(input())
T, A = map(int, input().split())
H = list(map(int, input().split()))
ans = 0
m = A
for i in range(N):
  if m > abs(T - H[i] * 0.006 - A):
    m = abs(T - H[i] * 0.006 - A)
    ans = i + 1
print(ans)
# Judge status: Wrong Answer
s=input()
t=input()
a,b=len(set(s)),len(set(t))
if not a==b:
  print('No')
  exit()
l=len(s)
for i in range(1,l):
  if (s[i]==s[i-1] and t[i]!=t[i-1]) or (s[i]!=s[i-1] and t[i]==t[i-1]):
    print('No')
    exit()
print('Yes')
# Judge status: Accepted
import fractions as f
A,B=map(int,input().split())
print(int((A*B)/f.gcd(A,B)))
# Judge status: Wrong Answer
n = int(input())
p = [int(i) for i in input().split()]
ans = 0
for i in range(n - 1):
    if p[i] == i + 1 and p[i + 1] == i + 2:
        p[i], p[i + 1] = p[i + 1], p[i]
        ans += 1
    elif p[i] == i + 1:
        p[i], p[i + 1] = p[i + 1], p[i]
        ans += 1
print(ans)
# Judge status: Wrong Answer
x,a,b = map(int,(input().split())) 

hantei = b - a

if hantei < 0:
    print("delicious")
elif x > hantei:
    print("safe")
else:
    print("dangerous")
# Judge status: Accepted
X, K, D = map(int, input().split())

if X == 0:
    if K % 2 == 0:
        print(0)
    else:
        print(abs(D))
    exit(0)
X = abs(X)
if X > 0:
    k = X - K * D
    if k >= 0:
        print(k)
    else:
        kouho1 = X % D
        kouho2 = abs(kouho1 - D)
        sho = X // D
        if (K - sho) % 2 == 0:
            print(kouho1)
        else:
            print(kouho2)
    exit(0)
# Judge status: Accepted
a = input()
count = 0
for i in range(3):
  if int(a[i]) == 1:
    count += 1
print(count)
# Judge status: Wrong Answer
N, A, B = list(map(int,input().split(" ")))

if (B-A)%2 == 0:
  print((B-A//2))
else:
  if N - A >= B:
    print(B)
  else:
    print(N-A)
# Judge status: Accepted
N=int(input())

word_set=set()
last_tail=""
for i in range(N):
  W=input()
  if W in word_set:
    print("No")
    break
  else:
    word_set.add(W)
    
  if len(word_set)>1 and last_tail!=W[0]:
    print("No")
    break
  else:
    last_tail=W[-1]
    
else:
  print("Yes")
# Judge status: Wrong Answer
import  math

# n = 1000000000000000000
n = int(input())

# nが奇数ならば必ず0
if n % 2 or n < 10:
    print(0)
else:
    s = 0
    for p in range(0, 50):
        if 10 * (5 ** p) < n:
            s += math.floor(n / (10 * (5 ** p)))
        else:
            break

    print(s)

# 298023223876953125
# 1490116119384765625
# 1000000000000000000

# dividers = [(p, 5 ** p) for p in range(1, 26)]
# Judge status: Wrong Answer
a = (int)(input())
mons = list(map(int, input().split(" ")))
yuu = list(map(int, input().split(" ")))
count = 0
for i in range(a):
  if yuu[i] >= mons[i]:
    yuu[i] -= mons[i]
    mons[i] = 0
    count += mons[i]
    if yuu[i] >= mons[i + 1]:
      yuu[i] -= mons[i + 1]
      mons[i + 1] = 0
      count += mons[i + 1]
    else:
      mons[i + 1] -= yuu[i]
      count += yuu[i]
  else:
    mons[i] -= yuu[i]
    count += yuu[i]
print(count)
# Judge status: Accepted
n=int(input())
l=[0]*(10**5+1)
v=list(map(int,input().split()))
for i in range(n):
  x=v[i]
  if x==0:
    l[0]+=1
    l[1]+=1
  elif x==10**5:
    l[x-1]+=1
    l[x]+=1
  else:
    l[x-1]+=1
    l[x]+=1
    l[x+1]+=1
l.sort()
print(l[-1])
# Judge status: Wrong Answer
S=list(str(input()))
T=list(str(input()))
for i in range(len(S)//2 +2):
  if S==T:
    print('Yes')
    exit()
  a=S.pop(-1)
  S.insert(0,a)
print('No')
# Judge status: Accepted
# ABC168
# B (Triple Dots)
K = int(input())
S = input()
a = len(S)
if a <= K:
    print(S)
else:
    print(str(S[0:K])+'...')
# Judge status: Wrong Answer
N = int(input())
 
def check_divisor(number):
    divisors = 0
    for j in range(1, number+1, 2):
        if not (number%j):
            divisors += 1
            if divisors == 9: return False
    if divisors == 8: return True
    else: return False

count = 0
for i in range(1, N+1, 2):
	if check_divisor(i):
		count += 1
# Judge status: Accepted
import bisect
n,*A=map(int,open(0).read().split());A.sort();m=A[-1];i=bisect.bisect_right(A,m/2)
print(m,[A[i-1],A[i]][abs(A[i-1]-m/2)>abs(A[i]-m/2)])
# Judge status: Accepted
n = int(input())
h = list(map(int, input().split()))
ans = 0
i = 0
while i < n-1:
    k = 0
    while h[i] >= h[i+1]:
        k+=1
        i+=1
        if i >= n-1: break
    if k > ans:
        ans = k
    i+=1
print(ans)
# Judge status: Accepted
N = int(input())

def low_divisors(N):
  K=1
  low_divs = []
  while K*K <= N:
    if N%K == 0:
      low_divs.append(K)
    K += 1

  return low_divs

L_divs = low_divisors(N)
D = []

for i in range(len(L_divs)):
  D.append(L_divs[i]+N//L_divs[i])
  
print(min(D)-2)
# Judge status: Wrong Answer
N=int(input())
S=input()
cnt=0
for i in range(N):
    if S[i]==".":
        cnt+=1
    else:
        break
print(S.count(".")-cnt)
# Judge status: Accepted
import math
n = int(input())
n_list = [int(input()) for i in range(5)]
#print(n_list)
n_min = min(n_list)
ans = math.ceil(n/n_min) + 4
print(ans)
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
for i in range(0, 99):
    if a > b or i == c:
        print(i)
        break
    b = b - a
# Judge status: Accepted
n=int(input())
h=list(map(int,input().split()))
l=[]
for i in range(n-1):
    if h[i+1]-h[i]<=0:
        l.append(1)
    else:
        l.append(0)
ans=0
mn=0
for j in range(len(l)):
    if l[j]==0:
        ans=0
    else:
        ans+=1
        mn=max(ans,mn)
print(max(mn,ans))
# Judge status: Accepted
N, M = map(int, input().split())

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

if N - sum(data) >= 0:
    print(N-sum(data))
else:
    print(-1)
# Judge status: Accepted
N, K = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort()
s = 0
for a, b in AB:
    s += b
    if s >= K:
        ans = a
        break
print(ans)
# Judge status: Accepted
X=int(input())
a=100
i=0
while a<X:
    a+=int(a//100)
    i+=1
print(i)
# Judge status: Wrong Answer
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))

ans_num = 1
ans_para = h[0]
for i, r in enumerate(h):
    deg = t - (r * 0.006)
    ans_para_deg = t - (ans_para * 0.006)
    if (a - ans_para_deg) >= (a - deg):
        ans_para = r
        ans_num = i+1
print(ans_num)