peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import heapq
def _int(x):
    return -int(x)
N, M = map(int, input().split())
A = list(map(_int, input().split()))
heapq.heapify(A)
for i in range(M):
    x = heapq.heappop(A)
    heapq.heappush(A, x-x//2)
print(-sum(A))
# Judge status: Accepted
S = input()

ans = ""
for i in range(0,len(S)):
    ans += "x"

print(ans)
# Judge status: Accepted
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

N = I()
a = LI()

ANS = [0]*(10**5+1)
for i in range(N):
    b = a[i]
    if b == 0:
        ANS[b] += 1
        ANS[b+1] += 1
    else:
        ANS[b-1] += 1
        ANS[b] += 1
        ANS[b+1] += 1
        
print(max(ANS))
# Judge status: Wrong Answer
# スペース区切りの整数の入力
N, *d = map(int, open(0).read().split())

if N > 0:
	A = 1
	for O in d:
		A = A * O
		#print(O)
		if A >= 10 ** 18:
			A = -1
			break
else:
	A = 0

print(A)
# Judge status: Wrong Answer
N, C, K = map(int, input().split())
T = sorted([int(input()) for i in range(N)])

nw = T[0]
bs = 1
ans = 1
for i in range(1, N):
    t = T[i]
    if bs == C:
        bs = 0
        nw = t
        ans += 1
    elif t-nw > K:
        bs = 0
        nw = t
        ans += 1
    else:
        bs += 1

print(ans)
# Judge status: Wrong Answer
N, K = map(int,input().split())
D = list(input().split())
num = N
ans = False
while True:
    numstr = list(str(num))
    for i in range(len(numstr)):
        if numstr[i] in D:
            num += 10**(len(numstr)-1-i)
            break
        ans = num
    if ans != False:
        break
print(ans)
# Judge status: Accepted
import sys
import fractions
a, b = map(int, sys.stdin.readline().split())
gcd = fractions.gcd(a, b)
print(a * b // gcd)
# Judge status: Accepted
M=10**9+7
N=int(input())
la=list(map(int,input().split()))
ans=0
for i in range(60):
    n0=0
    n1=0
    for j in range(N):
        if la[j]&1:
            n1+=1
        else:
            n0+=1
        la[j]>>=1
    ans=(ans+n0*n1%M*(2**i%M))%M
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
h = list(map(int, input().split()))

dp = [0]*(10**6)
dp[0] = 0
for i in range(1, n):
    dp[i] = 10**9
    for j in range(1, k+1):
        if i-j >= 0:
            dp[i] = min(dp[i], dp[i-j]+abs(h[i]-h[i-j]))

print(dp[n-1])
# Judge status: Wrong Answer
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.append(k)
x=[]
for i in range(len (a)-1):
    x.append(a[i+1]-a[i])
print(sum(x)-max(x))
# Judge status: Accepted
N,K = map(int,input().split())
A = list(map(int,input().split()))
pos = 0
visit = [0] * N
move = []
roop = []
while visit[pos]!=2:
    if visit[pos]==0:
        move.append(pos)
    else:
        roop.append(pos)
    visit[pos] += 1
    pos = A[pos] - 1
if len(move)>K:
    print(move[K]+1)
else:
    print(roop[(K-(len(move)-len(roop)))%len(roop)]+1)
# Judge status: Accepted
n, k = map(int, input().split())
a = list(map(int, input().split()))

d = {}
for i in range(n):
    if a[i] in d:
        d[a[i]] += 1
    else:
        d[a[i]] = 1

if len(d.keys()) <= k:
    print(0)
else:
    a = list(d.values())
    b = sorted(d.values())[-k:]
    for i in b:
        if i in a:
            a.remove(i)
    print(sum(a))
# Judge status: Accepted
n=int(input())
a=int(input())
if a>=n%500:print("Yes")
else:print("No")
# Judge status: Accepted
input_line = input().split()
if input_line.count("5") == 2 and input_line.count("7") == 1:
	print("YES")
else:
	print("NO")
# Judge status: Accepted
def gcd(a, b):
    if a < b:
        a, b = b, a
    r = a % b
    while r != 0:
        a = b
        b = r
        r = a % b
    return b


if __name__ == "__main__":
    a, b = map(int,input().split())
    print(a * b // gcd(a,b))
# Judge status: Wrong Answer
weathers = list(input())
rainy = 0
seq_rainy = 0

for i in range(len(weathers)):
      #print(weathers[i],rainy,seq_rainy)
      if weathers[i] == "R":
            rainy += 1
      else:
            if rainy >= seq_rainy:
                  seq_rainy = rainy
            rainy = 0

print(seq_rainy)
# Judge status: Accepted
n = int(input())
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))

l = []
cnt = 0
for i in range(1,n+1):
    cnt = sum(a1[:i])+sum(a2[i-1:])
    l.append(cnt)
    cnt = 0
print(max(l))
# Judge status: Accepted
n,k = map(int,input().split())
X = list(map(int,input().split()))

ans = float('inf')
for i in range(n-k+1):
    x = X[i]
    y = X[i+k-1]
    if x==0 and y==0:
        ans = 0
    if x<0 and y<=0:
        ans = min(ans,abs(x))
    if x>=0 and y>0:
        ans = min(ans,y)
    if x<0 and y>0:
        ans = min(ans,min(abs(x),y)*2+max(abs(x),y))
    if X[i]>=0:
        break
print(ans)
# Judge status: Wrong Answer
n=int(input())
w=input()
wordlength=len(w)
if n>=wordlength: print(w)
else: print(w[:n])
# Judge status: Accepted
#laczil
def solve():
    N = int(input())
    S = input()
 
    left_black = 0
    right_white = 0
    for i in range(N):
        if S[i] == '.':
            right_white += 1
 
    ans = left_black + right_white
    for i in range(N):
        if S[i] == '#':
            left_black += 1
        else:
            right_white -= 1
        ans = min(ans, left_black + right_white)
    print(ans)
 
if __name__ == '__main__':
    solve()
# Judge status: Accepted
a = int(input())

if a >= 30:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
n = int(input())
ans = 0
for i in range(1,n+1,2):
    a = 0
    for j in range(1,i+1): 
            if i % j == 0:
                a += 1
    if a == 8:
        ans += 1
        
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split( )))
Nodes = [1 for _ in range(N+1)]
for i in range(1,N+1):
  Nodes[i] = (Nodes[i-1]-A[i-1])*2
before = 0
ans = 0
for a,n in zip(A[::-1],Nodes[::-1]):
    if (n - a) >= before:
        before = before + a
    elif (n - a)*2 >= before :
        before = n
    else:
        ans = -1
        break
    ans += before
print(ans)
# Judge status: Accepted
def solve():
    N = int(input())
    S = input()
    ans = ''
    for i in S:
        if ord(i) + N > 90:
            ans += chr(ord(i) + N - 26)
        else:
            ans += chr(ord(i) + N)

    return ans

print(solve())
# Judge status: Accepted
n,k = map(int,input().split())
p = [0 for _ in range(k)]
for i in range(n):
    index = i%k
    p[index] += 1
print(max(p)-min(p))
# Judge status: Accepted
a, b, c = map(int, input().split())

print(a * b // 2)
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

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

ans = [-1, 0, 0]

import bisect

i = a[-1]
idx = [bisect.bisect_left(a, i // 2), bisect.bisect_left(a, i // 2) - 1]

if abs(i // 2 - a[idx[0]]) < abs(i // 2 - a[idx[1]]):
    print(i, a[idx[0]])    
else:
    print(i, a[idx[1]])
# Judge status: Wrong Answer
x=int(input())
for i in range(x,10**5+1):
    for j in range(2,i):
        if i%j==0:
            break 
    else:
         print(i)
         break
# Judge status: Accepted
def solve(n):
    cands = [6 ** i for i in range(1, 7)] + [9 ** i for i in range(1, 6)]
    m = len(cands)
    dp = [(0, 0)] * (n + 1)
    for i in range(6, n + 1):
        dp[i] = max(
            ((dp[i - cand][0] + cand, dp[i - cand][1] + 1) for cand in cands if i >= cand),
            key=lambda x: (x[0], -x[1])
        )
    return n - dp[n][0] + dp[n][1]

_n = int(input())
print(solve(_n))
# Judge status: Accepted
n,m = map(int,input().split())
print(abs((n-2)*(m-2)))
# Judge status: Accepted
#infinity Coins
n=int(input())
a=int(input())

if n%500 <= a :
    print("Yes")
else :
    print("No")
# Judge status: Wrong Answer
a,b,c=map(int,input().split())
a,b,c=sorted([a+(a%2==b%2 ^ a%2==c%2),b+(b%2==a%2 ^ b%2==c%2),c+(c%2==a%2 ^ c%2==b%2)])
print((c-a)//2+(c-b)//2+(a%2!=b%2 or b%2!=c%2))
# Judge status: Accepted
import sys
from bisect import bisect_right

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60


def main():
    N, *A = map(int, read().split())

    A.reverse()

    dp = [A[0]]
    for a in A[1:]:
        if a >= dp[-1]:
            dp.append(a)
        else:
            dp[bisect_right(dp, a)] = a

    print(len(dp))
    return


if __name__ == '__main__':
    main()
# Judge status: Accepted
n = int(input())
cand_judge = lambda x: (1 + x) * x / 2
cand_i = 0

for i in range(10 ** 5):
    if cand_judge(i) >= n:
        cand_i = i
        break

ans = list(range(1, cand_i + 1))
for i in ans:
    if i != abs(n - cand_judge(cand_i)):
        print(i)
# Judge status: Accepted
# coding: utf-8
from math import ceil
N, H = map(int, input().split())
li = []
atop = 0
for _ in range(N):
    a, b = map(int, input().split())
    atop = max(atop, a)
    li.append([a, b])
li.sort(key=lambda x: x[1], reverse=True)
# print(li)
ans = ceil(H/atop)
cnt = 0
for i in range(N):
    H -= li[i][1]
    cnt += 1
    ans = min(ans, cnt + max(0, ceil(H/atop)))
print(ans)
# Judge status: Accepted
N,K,Q = map(int,input().split())

import numpy as np

points=np.array([K]*N)
dis = np.array([0]*N)
for i in range(Q):
    a = int(input())
    a=a-1
    dis[a]+=1

points-=Q
points += dis

for j in points:
    if j>0:
        print('Yes')
    else:
        print('No')
# Judge status: Wrong Answer
S = input()
T = input()
slen = len(S)
tlen = len(T)
ans = 0
for i in range(slen - tlen):
    count = 0
    for j in range(tlen):
        if S[i+j] == T[j]:
            count += 1
    ans = max(ans,count)
print(tlen-ans)
# Judge status: Accepted
h1, m1, h2, m2, k = map(int, input().split())
st = h1*60 + m1
end = h2*60 + m2
print(end-st-k)
# Judge status: Accepted
#template
def inputlist(): return [int(j) for j in input().split()]
#template
#issueから始める
Q,H,S,D = inputlist()
N = int(input())
l = min(4*Q,2*H,S)
l2 = min(2*l,D)
d2 = N//2
d1 = (N-d2*2)
print(d2*l2 + d1*l)
# Judge status: Wrong Answer
n=int(input())
mod=10**9+7
l=list(map(int,input().split()))
d=len(str(bin(max(l))))-2
ll=[[0,0] for i in range(d)]
ans=0
for i in l:
  f=bin(i)[2:]
  for v in range(len(f)):
    ll[v][int(f[v])]+=1
for i,(a,s) in enumerate(ll):
  ans+=pow(2,i,mod)*a*s%mod
  ans%=mod
print(ans)
# Judge status: Accepted
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

A, B = map(int, input().split())
list_n = list(map(str, input().rstrip('\n').split("-")))
# print(list_n[0])
# print(list_n[1])
if len(list_n[0]) == A and len(list_n[1]) == B:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
import sys

input = sys.stdin.readline

def main():
    l = []
    N = int(input())
    T, A = map(int, input().split())
    h = list(map(int, input().split()))
    for  i in range(N):
      l.append(abs(A-abs(T-h[i]*6)))
    print(l.index(min(l))+1)

if __name__ == '__main__':
    main()
# Judge status: Accepted
# -*- coding: utf-8 -*-
k = int(input())
a,b = map(int,input().split())

ans = "NG"
for i in range(a, b + 1):
    if i % k == 0:
        ans = "OK"
print(ans)
# Judge status: Accepted
N, K = map(int, input().split())
P = sorted(list(map(int, input().split())))
print(sum(P[:K]))
# Judge status: Accepted
N = int(input())
A = [int(x) for x in input().split()]
A.sort(reverse = True)

s = []
i = 0
while i < N - 1:
    if A[i] == A[i + 1]:
        s.append(A[i])
        if len(s) == 2:
            print(s[0] * s[1])
            break
        i += 2
    else:
        i += 1
else:
    print(0)
# Judge status: Accepted
N = int(input())
x = int(input())
y = int(input())
A = [x, y]
if x < y:
    x, y = y, x
for i in range(N - 2):
    a = int(input())
    A.append(a)
    if x <= a:
        y = x
        x = a
    elif y < a:
        y = a
if x == y:
    for i in range(N):
        print(x)
else:
    for a in A:
        if a == x:
            print(y)
        else:
            print(x)
# Judge status: Accepted
def main():
    N,M,X,Y = map(int,input().split())
    x = [int(i) for i in input().split()]
    y = [int(i) for i in input().split()]
    maxx = max(x)
    miny = min(y)
    for z in range(X+1,Y+1):
        if maxx<z and miny>=z:
            print('No War')
            exit()
    print('War')
main()
# Judge status: Wrong Answer
N=int(input())
H=[int(i) for i in input().split()]
dp=[0]*(N+5)
dp[0]=0
dp[1]=abs(H[1]-H[0])
for i in range(1,N):
  dp[i]=min(dp[i-2]+abs(H[i-2]-H[i]),dp[i-1]+abs(H[i-1]-H[i]))
print(dp[N-1])
# Judge status: Accepted
from math import gcd
n, x = map(int, input().split())
ls = sorted(list(map(int, input().split())))
if x == 1:
    print(abs(x-ls[0]))
    exit()
distant = []
for i in range(n):
    diff = abs(ls[i]-x)
    distant.append(diff)
distant.sort()
a = distant[0]
for i in distant:
    g = gcd(a, i)
    a = g
print(g)
# Judge status: Wrong Answer
a = list(map(int, input().split(" ")))

a.sort(reverse=True)

print(int(a[2])*10 + int(a[1]) + int(a[2]))
# Judge status: Accepted
S = input()
amari = [0]*2019
ans = 0
amari[0] = 1
A = 0
for i in range(len(S)):
    A += pow(10, i, 2019)*(int(S[len(S)-1-i]))
    amari[A % 2019] += 1
for i in amari:
    if i >= 2:
        ans += i*(i-1)/2
print(int(ans))
# Judge status: Accepted
import sys

sys.setrecursionlimit(500005)
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
a = na()
f = [0] * 100001
s = sum(a)
for v in a:
    f[v] += 1

q = ni()
for z in range(q):
    b, c = na()
    s += (c-b) * f[b]
    f[c] += f[b]
    f[b] = 0
    print(s)
# Judge status: Accepted
def main():
    N, L = (int(i) for i in input().split())
    A = [input() for i in range(N)]
    A.sort()
    print("".join(A))


if __name__ == '__main__':
    main()
# Judge status: Accepted
import math
a, b, x = map(int, input().split())

if (a**2) * b / x >= 2:
    h = 2 * x / (a * b)
    theta = math.atan(b/h)
else:
    h = (b - (x / (a ** 2))) * 2
    theta = math.atan(h/a)

print(math.degrees(theta))
# Judge status: Accepted
s = list(input())

if len(set(s)) == 1:
    print('No')
else:
    print('Yes')
# Judge status: Wrong Answer
import numpy as np
N=int(input())
X=np.array(list(map(int,input().split())))
ans=sum(X**2)
for i in range(min(X),max(X)):
    Z=sum(X**2)-sum(2*X*i)+N*i**2
    ans=min(Z,ans)
print(ans)
# Judge status: Wrong Answer
N,M=map(int,input().split())
print(M//N if M%N==0 else M%N)
# Judge status: Accepted
def yaya(boo):
  if boo:
    print("Yes")
  else:
    print("No")
a,b,c=map(int,input().split())
yaya(a<=c and c<=b)
# Judge status: Accepted
a,b,c = map(int,input().split())
k = int(input())
ans = a+b+c
x = max(a,b,c)
print(x*(2)**(k)+ans-x)
# Judge status: Accepted
A, B, C, D = map(int, input().split())

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

def lcm(x, y):
    return x * y // gcd(x, y)

# CとDの最大公約数
E = lcm(C, D)

F = 0
F += B // C + B // D - B // E
F -= (A - 1) // C + (A - 1) // D - (A - 1) // E

print(B - A + 1 - F)
# Judge status: Accepted
A, B = map(int, input().split())

def f(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n /= i
            table.append(i)
            n = int(n)
        i += 1
    if n > 1:
        table.append(n)
    return table
    

a = set(f(A))
b = set(f(B))

a_and_b = a & b
# print(a_and_b)
print(len(a_and_b) + 1)
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))

c=[]
for i in range(n):
  for j in range(i+1,n):
    for k in range(j+1,n):
      c.append((i,j,k))
cnt=0
for i in c:
  s=l[i[0]]
  t=l[i[1]]
  u=l[i[2]]
  
  if s+t>u and t+u>s and u+s>t and len(set([s,t,u]))==3:
    cnt+=1
print(cnt)
# Judge status: Accepted
import numpy as np
N,K = map(int,input().split())
A = np.array(input().split(), dtype=np.int32)
counter = np.bincount(A)
counter.sort()
counter = counter[::-1] 
no_change = counter[:K].sum()
answer = N - no_change
print(answer)
# Judge status: Wrong Answer
n = int(input())
if n == 1:
    print(1)
else:
    print(1 - (2 / n))
# Judge status: Accepted
import fractions
s=list(map(int,input().split()))
t=[int(i)//2 for i in input().split()]
ans = t[0]
for i in range(1,s[0]):
  ans=(ans*t[i])//fractions.gcd(ans,t[i])
  if ans>10**10:
    print(0)
    exit()
for j in t:
  if (ans//j)%2==0:
    print(0)
    exit()
if ans<=s[1]:
  print(int((s[1]//ans+1)//2))
else:
  print(0)
# Judge status: Accepted
n, K = map(int,input().split())
A = list(map(int,input().split()))

for _ in range(K):
    b = [0 for _ in range(n+1)]
    for i,a in enumerate(A):
        b[max(0, i-a)] += 1
        b[min(n, i+a+1)] -= 1

    for i in range(n):
        b[i+1] += b[i]

    A = b[:-1]
    if all(a == n for a in A):
        break
print(*A)
# Judge status: Accepted
s=input()
if s[0]=="9" or s[1]=="9":
	print("Yes")
else:
  print("No")
# Judge status: Accepted
a,b = map(int, input().split())
print((a+b)%24)
# Judge status: Accepted
n = int(input())
s = {}
for _ in range(n):
  line = input()
  if line in s:
    s[line] += 1
  else:
    s[line] = 1
s = sorted(s.items(), reverse=True, key=lambda x : x[1])
tn = s[0][1]
ans = []
for l in s:
  if l[1] == tn:
    ans.append(l[0])
  else:
    break
for l in sorted(ans):
  print(l)
# Judge status: Wrong Answer
a, b = map(int, input().split());

if a * b < 0 : 
  print('zero')
  exit(0)

if a > 0 and b > 0 :
  print('Positive')
  exit(0)

if(abs(a - b) % 2 == 1) : 
  print('Positive')
else :
  print('Negative')
# Judge status: Accepted
from fractions import gcd

N, X = map(int, input().split())
x = sorted(list(map(int, input().split())))

diff = [abs(_x - X) for _x in x]
ans = diff[0]
for d in diff:
  ans = gcd(ans, d)

print(ans)
# Judge status: Wrong Answer
N = int(input())

ans = {}
for x in range(1, 42):
    for y in range(1, 42):
        for z in range(1, 42):
            tmp = x**2+y**2+z**2+x*y+x*z+y*z
            if not(tmp in ans):
                ans[tmp] = 1
            else:
                ans[tmp] += 1

for i in range(1, N+1):
    if i in ans:
        print(ans[i])
    else:
        print(0)
# Judge status: Accepted
N, K = map(int, input().split())
A = list(map(int, input().split()))
for i in range(min(K,300)):
    imos = [0]*(N+1)
    for i, ai in enumerate(A):
        imos[max(0, i-ai)] += 1
        imos[min(N, i+ai+1)] -= 1
    A = [imos[0]]
    for i in range(1, N):
        A += [imos[i]+A[i-1]]
print(' '.join(map(str, A)))
# Judge status: Accepted
n = int(input())
lst_4 = [x for x in range(4, 101, 4)]
lst_7 = [x for x in range(7, 101, 7)]
lst = []
for i in lst_4:
    for j in lst_7:
        lst.append(i)
        lst.append(j)
        lst.append(i + j)

ans = [x for x in lst if x <= 100]
print('Yes' if n in ans else 'No')
# Judge status: Wrong Answer
a, b, c, d = list(map(int, input().split()))
if c < a:
    print(0)
if b < c:
    print(0)
if b < d:
    print(b - c)
else:
    print(d - c)
# Judge status: Accepted
money = int(input())
ans = 1000 - money % 1000
if int(ans) == 1000:
    print(0)
else:
    print(int(ans))
# Judge status: Wrong Answer
A, B, M = map(int, input().split())
ref = list(map(int, input().split()))
mic = list(map(int, input().split()))
coupons = [ list(map(int, input().split())) for i in range(M)]
ans = min(ref) + min(mic)

for i in coupons:
  print(i)
  price = ref[i[0]-1] + mic[i[1]-1] - i[2]
  if price < ans:
    ans = price

print(ans)
# Judge status: Accepted
def main():
    A, B, T = map(int, input().split())
    ans = (T//A)*B
    print(ans)

if __name__ == '__main__':
    main()
# Judge status: Accepted
x = int(input())
for i in range(200):
    for j in range(i+1):
        if i**5 - j**5 ==x:
            print(i,j)
        elif i**5 + j**5 ==x:
            print(i,-j)
# Judge status: Accepted
N, H = map(int, input().split())

A = []
B = []
a_max = 0
for _ in range(N):
    a, b = map(int, input().split())
    a_max = max(a, a_max)
    A.append(a)
    B.append(b)

B = sorted(B, reverse=True)

ans = 0
f = 0

for i in B:
    if i < a_max:
        continue
    ans += 1
    H -= i
    if H <= 0:
        f = 1
        break

if f:
    print(ans)
else:
    if H%a_max == 0:
        print(ans + H//a_max)
    else:
        print(ans + H//a_max+1)
# Judge status: Accepted
n, d = map(int, input().split())


x = []
y = []
for i in range(n):
    i1, i2 = map(int, input().split())
    x.append(i1)
    y.append(i2)


ans = 0

for i in range(n):
    dist = x[i]*x[i] + y[i]*y[i]
    if dist <= d*d:
        ans = ans+1

print(ans)
# Judge status: Accepted
n = int(input())
a = [int(x) for x in input().split()]
ans = 0
for i in range(n):
    for j in range(i+1, n):
        for k in range(j+1, n):
            m = max(a[i], a[j], a[k])
            if len(set([a[i], a[j], a[k]])) == 3 and m < (a[i] + a[j] + a[k] - m):
                ans+= 1
print(ans)
# Judge status: Accepted
x =int(input())
print('YES' if x == 7 or x==5 or x==3 else 'NO')
# Judge status: Wrong Answer
N = int(input())
S = list(map(int,input().split()))
counter = int(0)
minNum = S[0]

if N == 1:
  print("1")

else:
  for i in range(N):
    if minNum >= S[i]:
      counter = counter + 1
    else:
      minNum = S[i]
    
  print(counter)
# Judge status: Accepted
def inpl():
    return list(map(int, input().split()))


A, B, C, X, Y = inpl()

ans = min(A + B, 2 * C) * min(X, Y)

if X > Y:
    ans += min(A, 2 * C) * (X - Y)
elif Y > X:
    ans += min(B, 2 * C) * (Y - X)

print(ans)
# Judge status: Accepted
N = int(input())
s = [int(input()) for i in range(N)]
s.sort()
ans = 0
check = 0
for i in s:
    if i % 10 != 0:
        check = 1
        break

if check == 0:
    ans = 0
else:
    ans = sum(s)
    if ans % 10 == 0:
        for i in s:
            if i % 10 != 0:
                ans -= i
                break

print(ans)
# Judge status: Wrong Answer
import numpy as np
N, M = map(int, input().split(' '))

height = np.array(list(map(int, input().split(' '))))
#height_all = height

for i in range(M):
  a, b = map(int, input().split(' '))
  #print(a, b, height[a - 1], height[b - 1])
  if height[a - 1] > height[b - 1]:
    height[b - 1] = 0
   
  else:
    height[a - 1] = 0
  
print(len(np.nonzero(height)))
# Judge status: Wrong Answer
N,A,B = map(int, input().split())

#一人目と二人目の間に奇数人存在
if (B-A+1)%2!=0:
    print(B-A-1)
    exit()

if (A-1)<=(B-1):
    print(B-1)
else:
    print(A-1)
# Judge status: Wrong Answer
#C
import math
n = int(input())
a=[0]*5
for i in range(5):
    a[i] = int(input())
time = math.ceil(n / a[0])
for i in range(4):
    if a[i] < a[i + 1]:
        a[i + 1] = a[i]
    time += math.ceil(a[i] / a[i + 1])
    # print(time)
print(time)
# Judge status: Accepted
N=int(input())
print(int(N**0.5)**2)
# Judge status: Wrong Answer
import sys

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

for a in range(n):
	if n-2*a == 0:
		continue
	b = ((k-a*m))/(n-2*a)
	if (b >= 0) and (b <= m) and (b%1 == 0):
		print("YES")
		sys.exit()

print("NO")
# Judge status: Wrong Answer
x=int(input())
i=100
c=0
while i<=x:
    i=i+(i//100)
    c=c+1
print(c)
# Judge status: Accepted
n, m = map(int, input().split())
if m > 2*n:
    print((m-2*n)//4+n)
else:
    print(m//2)
# Judge status: Accepted
from sys import stdin

def main():

    input = stdin.readline

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

    for i in range(1,1001):
        if(int(i * 0.08) == A) and (int(i * 0.1) == B):
            print(i)
            return
    else:
        print("-1")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
import math
import collections
import itertools

def resolve():

    N=int(input())

    ans=0
    for i in range(1,N):
        if(10<=i<=99 or 1000<=i<=9999 or 100000<=i<=999999):
            continue
        ans+=1
    print(ans)
resolve()
# Judge status: Wrong Answer
n=int(input())
k = [list(map(int, input().split())) for i in range(n)]
import math
ans=0
for i in range(n-1):
    for j in range(i+1,n):
        z=math.sqrt((k[i][0]-k[j][0])**2+((k[i][1]-k[j][1])**2))
        ans+=(n-1)*2*z

z=math.factorial(n)
print(ans/z)
# Judge status: Wrong Answer
import math
n, k = list(map(int, input().split(" ")))

a = n
c = 0
while True:
    a = a // k
    c += 1
    if a < k:
        print(c + 1)
        exit()
# Judge status: Accepted
N = int(input())
A = [int(s) for s in input().split()]

count = 0
for i in range(0, N, 2):
  if A[i] % 2 == 1:
    count += 1
    
print(count)