peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n=int(input())
list=[]
ans=0
sa=1
sas=0
for i in range(n):
    a=int(input())
    list.append(a)
list=sorted(list)
for i in range(n):
    if i!=0:
        if list[i]==list[i-1]:
            sa+=1
        else:
            sas=sa
            sa=1
            if sas%2!=0:
                ans+=1
print(ans)
# Judge status: Accepted
a = list(input())
b = list(input())

ans = 0
for p, q in zip(a, b):
    if p != q:
        ans += 1
print(ans)
# Judge status: Wrong Answer
import math
x=int(input())
print(int(math.sqrt(x)))
# Judge status: Accepted
import sys

import math
import itertools
import random
n=int(input())
a=list(map(int, input().split()))
cnt=0
for i in range(n):
    if(i%2==0 and a[i]%2==1):
        cnt+=1
print(cnt)
# Judge status: Accepted
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

l = []
l.append(a)
l.append(b)
l.append(c)
l.append(d)
l.append(e)
ans = 0
for i in range(5):
    for j in range(i+1,5):
        if l[j] - l[i] > k :
            ans += 1

if ans == 0 :
    print("Yay!")
else :
    print(":(")
# Judge status: Accepted
a, b = map(str, input().split())
s = int(a+b)
for i in range(1, s+1):
    if i**2 == s:
        print('Yes')
        exit()
else:
    print('No')
# Judge status: Accepted
s=input()

#Aのインデックス
num_a=s.index("A")

#Zのインデックス
num_z=len(s)-1-s[::-1].index("Z")

print(num_z-num_a+1)
# Judge status: Wrong Answer
n,k,s = map(int,input().split())
ans = []
kazu = 0

for i in range(n):
    if kazu != k:
        ans.append(s)
        kazu += 1
    else:
        ans.append(s+1)

for i in ans:
    print(i,end=' ')

print()
# Judge status: Wrong Answer
n,k=map(int,input().split())
s=input()
print(s.replace(s[k-1],s[k-1].lower(),1))
# Judge status: Accepted
n, x = map(int, input().split())
a_list = list(map(int, input().split()))

cnt = 0
for i in range(n-1):
    total = a_list[i] + a_list[i+1]
    if total > x:
        diff = total - x
        cnt += diff

        if a_list[i+1] >= diff:
            a_list[i+1] -= diff
        else:
            a_list[i] = diff - a_list[i+1]
            a_list[i+1] = 0
print(cnt)
# Judge status: Accepted
# coding: utf-8
import heapq
n,k = [int(x) for x in input().split()]
h = sorted([int(x) for x in input().split()])
#print(h)
s = 0
if k >= n:
    print(0)
else:
    h = h[:n-k]
    for j in h:
        s += j
    print(s)
# Judge status: Accepted
n,k = map(int,input().split())
count = [0]*n
for _ in range(k):
    d = int(input())
    a = map(int,input().split())
    for i in a:
        count[i-1]+=1
        
ans = 0
for i in count:
    if i == 0:
        ans += 1
    
print(ans)
# Judge status: Accepted
K, S = list(map(int, input().split()))
cnt = 0
for x in range(K + 1):
    for y in range(K + 1):
        if 0 <= S - x - y <= K:
            cnt += 1
print(cnt)
# Judge status: Accepted
# coding:utf-8

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

if abs(a - b) > 10 ** 18:
    print('Unfair')
elif k % 2 == 0:
    print(a - b)
else:
    print(b - a)
# Judge status: Accepted
#<100q.全探索（計算量注意）>
a, b, c, x, y = map(int,input().split())
ans1 = a * x + b * y
if x <= y:
    ans2 = c * 2 * x + b * (y - x)
    ans5 = c * 2 * y
else:
    ans2 = c * 2 * y + a * (x - y)
    ans5 = c * 2 * x
ans3 = a * x + c * 2 * y
ans4 = b * y + c * 2 * x
##print(ans1)
##print(ans2)
##print(ans3)
##print(ans4)
##print(ans5)
print(min(ans1,ans2, ans3, ans4, ans5))
# Judge status: Wrong Answer
n = int(input())

if n < 2:
    print(1)
elif n % 2 != 0:
    print(0)
else:
    ans = 0
    for i in range(1, 100):
        ans += n//(5**i*2)
    print(ans)
# Judge status: Wrong Answer
x = int(input())
ans = 0
k = 0
while x - k > 0:
    for i in range(int((2*(x-k))**0.5),int((2*(x+1-k))**0.5)+2):
        if i*(i+1) == 2*(x - k):
            #print(i,k)
            print(i+k)
            break
    else:
        k += 1
        continue
    break
else:
    print(k)
# Judge status: Wrong Answer
S = input()
slen = len(S)
count = 0
for i in range(0,slen, 2):
    if ( i == slen-1):
        inv = 0 if i == 0 else 10 ** i
        count = count + (int(S)-inv) + 1
        # print(i, (int(S)-inv) + 1)
    else:
        count = count + 10 ** (i+1) - 10 ** (i)
        # print(i, 10 ** (i+1) - 1)
print(count)
# Judge status: Accepted
import sys
from bisect import bisect
from itertools import accumulate

n, m, k, *ab = map(int, sys.stdin.buffer.read().split())
aaa = [0] + ab[:n]
bbb = [0] + ab[n:]
acc = list(accumulate(aaa))
bcc = list(accumulate(bbb))

ans = 0
for i in range(n + 1):
    r = k - acc[i]
    if r < 0:
        break
    j = bisect(bcc, r) - 1
    ans = max(ans, i + j)
print(ans)
# Judge status: Accepted
S = map(int, input())

a, b = 0, 1
for s in S:
    a, b = min(a + s, b + 10 - s), min(a + (s + 1), b + 10 - (s + 1))

print(a)
# Judge status: Accepted
N = int(input())
S = input()
print('Yes' if (N % 2 == 0) and (S[:N // 2] == S[N // 2:]) else 'No')
# Judge status: Wrong Answer
X = int(input())
hap_yen = int(X / 500)
to_hap_yen = hap_yen * 1000
remain_X = X - (hap_yen * 500)
remain_hap_yen = (remain_X / 5) * 5
total_hap_yen = to_hap_yen + remain_hap_yen
print(int(total_hap_yen))
# Judge status: Accepted
X, Y = map(int, input().split())
ans = 0
while True:
    if X <= Y:
        ans += 1
        X *= 2
    else:
        break

print(ans)
# Judge status: Accepted


def solve():
    N, K = map(int, input().split())
    Ax = list(map(int, input().split()))
    if N == K:
        print(1)
        exit()

    N -= K
    ans = 1

    while N > 0:
        N = N-(K-1)
        ans += 1

    print(ans)


# Solve
if __name__ == "__main__":
    solve()
# Judge status: Accepted
k,n = map(int,input().split())
a_list = list(map(int,input().split()))
re_a = []
for x in a_list:
    re_a.append(x-k)
a_list_add_re = re_a+a_list
result = []
x = n - 1
for i in range(len(a_list_add_re)-x):
    result.append(a_list_add_re[i+x] - a_list_add_re[i])
    
print(min(result))
# Judge status: Wrong Answer
N=input()
l=len(N)
if(N[:l]=='e'):
 print(N+'s')
elif(N[-1]=='x'):
 print(N+'s')
else:
 print(N+'es')
# Judge status: Accepted
def main():
    a, b, x = map(int, input().split())
    if a+b < x or a > x:
        print("NO")
    else:
        print("YES")

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
#!/usr/bin/env python3

import sys
  
if sorted(sys.stdin.read().split(' ')) == ['5', '5', '7']:
  print('YES')
else:
  print('NO')
# Judge status: Accepted
def f(n,a):
    if n==1:
        print(1)
        exit()
    pre=a[1]-a[0]
    ans=1
    for i in range(2,n):
        if pre*(a[i]-a[i-1])<0:
            pre=0
            ans+=1
        else:
            if a[i]-a[i-1]:###
                pre=a[i]-a[i-1]
    return ans

n=int(input())
*a,=map(int,input().split())
print(f(n,a))
# Judge status: Wrong Answer
n=int(input())
if n==1:
  print('1,0')
elif n%2==0:
  print(n//2/n)
else:
  print(n/2/n)
# Judge status: Wrong Answer
a,b,c,k=map(int,input().split())
inf=10**18+1
flag=True
nin=min(a,b,c)
temp=1
for j in range(k):
    temp*=nin
    if temp>inf:
        flag=False
        break

if flag:
    for j in range(k):
        tempa=a
        tempb=b
        tempc=c
        a=tempb+tempc
        b=tempa+tempc
        c=tempa+tempb


ans=a-b

if not(flag) or abs(ans)>inf:
    print('Unfair')
else:
    print(ans)
# Judge status: Accepted
import fractions
n = int(input())
a = list(map(int, input().split()))

ans = a[0]
for x in a:
  ans = fractions.gcd(ans, x)
print(ans)
# Judge status: Accepted
T = list(input())
for i in range(len(T)):
    if T[i] == '?':
        T[i] = 'D'
print(''.join(T))
# Judge status: Accepted
from collections import deque

def main():
    N = int(input())
    S = list(input())
    Stmp = S.copy()
    Stmp = deque(Stmp)
    cnt = 0
    for s in S:
        cnt += (s=='(') - (s==')')
        if cnt < 0:
            Stmp.appendleft('(')
            cnt += 1
    for _ in range(cnt):
        Stmp.append(')')
    print(''.join(Stmp))

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))
a_i = max(a)
a.sort(key=lambda x: abs(a_i/2-x))

print(a_i, a[0])
# Judge status: Accepted
import math
import math
from functools import reduce
#import itertools
#import statistics
#import numpy as np
#import collections
n = int(input())
#h  = list(map(int, input().split()))
#h, w = list(map(int, input().split()))


def gcd(*numbers):
    return reduce(math.gcd, numbers)

ans = 0
for i in range(1, n+1):
    for j in range(1, n+1):
        for k in range(1, n+1):
            ans += gcd(i, j, k)



#print(gcd(27, 18, 3))
print(ans)
# Judge status: Accepted
def main():
  N = int(input())
  A = [int(input()) for _ in range(N)]
  s = sum(A)
  if s%10 != 0:
    print(s)
    return
  m = 10000
  for a in A:
    if a%10 != 0:
      m = min(m, a)
  print(s - m if m != 10000 else 0)
  return

if __name__ == '__main__':
  main()
# Judge status: Accepted
#codinf utf-8
s = list(input())
K = int(input())
N = len(s)
alp = [chr(i) for i in range(97, 97+26)]

for i in range(N):
    idx = alp.index(s[i])
    
    if K + idx >= 26 and idx != 0:
        K = K - ( 26 - idx )
        s[i] = 'a'
    if K == 0:
        break
    
if K > 0:
    id = alp.index(s[N-1])

    id_ = ( id + K ) % 26

    s[N-1] = alp[id_]

print(''.join(s))
# Judge status: Accepted
import sys
readline = sys.stdin.readline

N,K = map(int,readline().split())
R,S,P = map(int,readline().split())
T = list(readline().rstrip())

P = {"r":P,"s":R,"p":S}
ans = 0
for i in range(len(T)):
  if i < K:
    ans += P[T[i]]
    continue
  if T[i] == T[i - K]:
    T[i] = "x"
  else:
    ans += P[T[i]]
print(ans)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))

import math

B = sorted([a-i for i,a in enumerate(A, start=1)])

ans = []

if N%2 == 1:
    b = B[N//2]
    ans.append(sum([abs(x - b) for x in B]))
else:
    b_left = (B[N//2 - 1] + B[N//2])//2
    b_right = math.ceil((B[N//2 - 1] + B[N//2])/2)
    ans.append(sum([abs(x - b_left) for x in B]))
    ans.append(sum([abs(x - b_right) for x in B]))

print(min(ans))
# Judge status: Accepted
ABC = set(map(int, input().split()))
print("Yes" if len(ABC) == 2 else "No")
# Judge status: Wrong Answer
n,m = map(int,input().split())
print(n+(m/2))
# Judge status: Wrong Answer
w,a,b = map(int,input().split())
c = b - a
if c - w >= 0:
    print(c - w)
else:
    print("0")
# Judge status: Accepted
N = int(input())
H = list(map(int, input().split()))
base = H[-1]
cnt = 0
ans = 0
if N == 1:
    print(0)
else:
    for h in H[N-2::-1]:
        if base <= h:
            cnt += 1
        else:
            ans = max(ans, cnt)
            cnt = 0
        base = h
    print(max(ans,cnt))
# Judge status: Wrong Answer
N,M=map(int,input().split())
A=[list(map(int,input().split())) for i in range(N)]
C=[list(map(int,input().split())) for i in range(M)]
for i in range(N):
    z=10**10
    ans=0
    for t in range(M):
        if abs(A[i][0]-C[t][0])+abs(A[i][0]-C[t][1])<z:
            z=abs(A[i][0]-C[t][0])+abs(A[i][0]-C[t][1])
            ans=t+1
        else:
            continue
    print(ans)
# Judge status: Wrong Answer
# -*- coding:utf-8 -*-

S = input()

if S == "Sunny":
    print("Cloudy")
elif S == "Cloudy":
    print("Rainy")
else:
    print("Rainy")
# Judge status: Wrong Answer
import sys

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

if N % 2 != 0:
    print(0)
    sys.exit()

low  = D[0:N//2]
high = D[N//2::]

cnt = 0
flg = True
for i in range(low[-1] - 1, min(high) + 1):
    flg = False
    flg  = all( i >  x for x in low )
    flg |= all( i >= x for x in high )

    if flg == True:
        cnt = cnt + 1

print(cnt)
# Judge status: Accepted
def l(): return list(map(int, input().split()))
def m(): return map(int, input().split())

def main():
  c = [0]*3
  for i in range(3):
    c[i] = l()
  for i in range(2):
    x = c[2][i+1] - c[2][i]
    for j in range(2):
      if c[j][i+1] - c[j][i] != x:
        print('No')
        exit()
  print('Yes')

  
if __name__ == '__main__':
  main()
# Judge status: Wrong Answer
N=int(input())
N = 27
ans = ""
def n(N):
    ans= ""
    for i in range(N):
        if N%26 ==0:
            ans = "z" +ans
            N -= 1
        else:
            ans = chr(64+ N%26) +ans
        
        if N <= 26:
            break
        N = N // 26
    return ans
    
for i in range(1,10000):
    print(n(i))
print(ans.lower())
# Judge status: Wrong Answer
r,g,b=map(int,input().split())
if (r*100+g*10+b) % 4 == 0:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
def resolve():
    a, v = map(int, input().split())
    b, w = map(int, input().split())
    T = int(input())
    if v <= w:
        print("NO")
        return
    if abs(a - b) <= T * abs(v - w):
        print("YES")
    else:
        print("NO")

resolve()
# Judge status: Accepted
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]

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

ans = 0

for i in range(2):
    if (a > b):
        ans += a
        a -= 1
    else:
        ans += b
        b -= 1
print(ans)
# Judge status: Accepted
a,b,c,d=input()
print(['No','Yes'][a==b==c or b==c==d])
# Judge status: Accepted
from sys import stdin
def main():
    #入力
    readline=stdin.readline
    p,q,r=map(int,readline().split())
    print(min(p+q,q+r,r+p))
    
if __name__=="__main__":
    main()
# Judge status: Wrong Answer
s = input()
t = input()
from collections import Counter

sc = Counter(s)
tc = Counter(t)

if set(sc.values()) == set(tc.values()):
    print('Yes')
else:
    print('No')
# Judge status: Accepted
S = input()
print("2018"+S[4:])
# Judge status: Accepted
s = input()
if [s[i]==s[i+1] for i in range(3)]==[False for i in range(3)]:
    print('Good')
else:
    print('Bad')
# Judge status: Wrong Answer
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

x,y,z = iim()
print((x-2*z)//(z+y))
# Judge status: Accepted
n = int(input())
a_l = list(map(int,input().split()))

num = 1
flag = -1 # -1:initial, 0:increasing, 1:decreasing
for i in range(1,n):
    if a_l[i] > a_l[i-1]:
        new_flag = 0
    elif a_l[i] < a_l[i-1]:
        new_flag = 1
    else:
        continue
    if new_flag != flag:
        if flag == -1:
            flag = new_flag
        else:
            flag = -1
            num += 1

print(max(num,1))
# Judge status: Wrong Answer
n=int(input())
a=list(map(str,input().split()))
b=list()
cnt=0
for i in a:
    if cnt==0:
        b.append(i)
        cnt=1
    else:
        b.insert(0,i)
        cnt=0
#L=[str(a) for a in b]
b=" ".join(b)
print(b)
# Judge status: Accepted
def actual(n):
    is_zorome = lambda num: len(set(str(num))) == 1

    for i in range(100, 1000):
        if i >= n and is_zorome(i):
            return i

n = int(input())
print(actual(n))
# Judge status: Accepted
from collections import Counter
n = int(input())
l = [int(input()) for _ in range(n)]
a = Counter(l).values()
print(sum(i%2 for i in a))
# Judge status: Wrong Answer
N = int(input())
AS = list(map(int, input().split()))
print(*AS, sep=" ")
# Judge status: Wrong Answer
N, K = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
s = 0
for a, b in AB:
    s += b
    if s >= K:
        ans = a
        break
print(ans)
# Judge status: Accepted
from math import gcd
from functools import reduce

n,m=map(int,input().split())
lst=list(map(lambda x : int(x)//2,input().split()))
divi=0
x=lst[0]
while x%2==0:
    x//=2
    divi+=1

for i in range(1,n):
    divi2=0
    x=lst[i]
    while x%2==0:
        x//=2
        divi2+=1
    if divi!=divi2 :
        print(0)
        exit()

work=reduce(lambda x,y: x*y//gcd(x,y),lst)
print((m//work+1)//2)
# Judge status: Wrong Answer
# coding:utf-8

N = int(input())
act = []
for i in range(N):
	act.append([int(x) for x in input().split()])

dp = [[0 for x in range(3)] for y in range(N+1)]

for i in range(0, N):
	for j in range(3):
		for k in range(3):
			if j != k:
				dp[i+1][j] = max(dp[i+1][k], dp[i][j] + act[i][k])

m = 0
for i in range(3):
	m = max(m, dp[N][i])

print(m)
# Judge status: Accepted
N, K = map(int, input().split())
keta = 0

while (N > 0):
    N = N // K
    keta += 1

print(keta)
# Judge status: Wrong Answer
s = input().strip()

min_diff = 1000000

for i in range(len(s) - 2):
    num = int(s[i: i+3])
    print(num)
    diff = abs(753 - num)
    min_diff = min(diff, min_diff)

print(min_diff)
# Judge status: Wrong Answer
import sys
row = sys.stdin.readline
def read_int(row):
    return int(row().rstrip())

A,B= [read_int(row) for i in range(2)]

print((set({1,2,3}) - set({1,2})).pop())
# Judge status: Wrong Answer
if __name__ == "__main__":
    N, W = map(int, input().split())
    dp = [0] * (W+1)

    for i in range(N):
        weight, value = map(int, input().split())
        # for w in range((W - weight)+1):
        for w in range((W - weight), -1, -1):
            dp[w + weight] = max(dp[w + weight], dp[w] + value)

        # dp = new_dp

    print(dp)
    print(dp[-1])











"""
6 15
6 5
5 6
6 4
6 6
3 5
7 2


3 8
3 30
4 50
2 60
"""
# Judge status: Wrong Answer
A, B, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ab = []
for i in range(min(A,B)):
  ab.append([a[i], b[i]])
ab.sort(key=lambda x: x[0])

ans = 10**5+1
for i in range(m):
  x, y, c = map(int, input().split())
  if m <= min(A, B):
    ans = min(ans, a[x-1] + b[y-1] - c, ab[i][0] + ab[i][1])
  else: 
    ans = min(ans, a[x-1] + b[y-1] - c)
  
print(ans)
# Judge status: Wrong Answer
d, t, s = [int(x) for x in input().split()]

time = d / s
time = int(time)

if time <= t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import sys
input=lambda: sys.stdin.readline().rstrip()
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if t*(v-w)>=abs(a-b):
  print("YES")
else:
  print("NO")
# Judge status: Accepted
# B

X,Y=map(int,input().split())
if Y<2*X or 4*X<Y:
    print("No")
else:
    if (Y-2*X)%2!=0 or (4*X-Y)%2!=0:
            print("No")
    else:
        print("Yes")
# Judge status: Accepted
import math
import functools
def lcm(x,y):
    return (x*y)//math.gcd(x,y)
n = int(input())
t = [int(input()) for i in range(n)]
a = functools.reduce(math.gcd,t)
print(functools.reduce(lcm,t))
# Judge status: Accepted
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=0
k=0
for i in range(n):
    k+=l[i]
    if k<=x:
        ans+=1
print(ans+1)
# Judge status: Accepted
n = int(input())
A = list(map(int,input().split()))

import collections
c = collections.Counter(A)

for i in range(n):
    print(c[i+1])
# Judge status: Wrong Answer
a=int(input())
b=int(input())
if (int(b/100))%5==0:
  if b%500<=a:
    print("Yes")
  else:
    print("No")
else:
  print("No")
# Judge status: Wrong Answer
import copy

n = int(input())

lis = []
for _ in range(n):
    lis.append(int(input()))
    
slis = sorted(copy.deepcopy(lis), reverse=True)
    
m = max(lis)
s = sorted(set(slis), reverse=True)
s.remove(m)
if s:
    sm  = max(s)
else:
    sm = m

for i in range(n):
    if lis[i] != m:
        print(m)
    else:
        print(sm)
# Judge status: Accepted
import math

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


def not_multiple_of_c_and_d(x: int, c: int, d: int):
    lcm_cd = c * d // math.gcd(c, d)
    c_no_baisu = x // c
    d_no_baisu = x // d
    cd_no_baisu = x // lcm_cd
    return x - (c_no_baisu + d_no_baisu - cd_no_baisu)


ans = not_multiple_of_c_and_d(B, C, D) - not_multiple_of_c_and_d(A-1, C, D)
print(ans)
# Judge status: Wrong Answer
import math
n = int(input())

res = 0
if n <= 1:
	print(res)
else:
	max_num = math.ceil(math.sqrt(n + 1))
	org_n = n
	for z in range(2, max_num + 1):
		if n == 1 or z >= math.ceil(math.sqrt(n)):
			res += 1
			break
		if n % z == 0:
			res += 1
			n = n // z
			if n == z:
				break
	print(res)
# Judge status: Accepted
N = int(input())

m = dict()
for i in range(1, N + 1):
    n = str(i)
    s = n[0]
    t = n[-1]
    
    if t == 0:
        continue
    
    k = (s, t)
    if k in m:
        m[k] += 1
    else:
        m[k] = 1

ans = 0
for k, v in m.items():
    s, t = k
    if s == t:
        ans += v ** 2
    else:
        if (t, s) in m:
            ans += v * m[(t, s)]

print(ans)
# Judge status: Accepted
import heapq
from collections import deque

X, Y, A, B, C = list(map(int, input().split()))
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

r.sort()

if A < X:
  p += r[-(X - A):]
  r = r[:-(X - A)]
  A = X

if B < Y:
  q += r[-(Y - B):]
  r = r[:-(Y - B)]
  B = Y

p.sort()
q.sort()

pq = deque(heapq.merge(p[A - X:], q[B - Y:]))

while r and pq[0] < r[-1]:
  pq.popleft()
  pq.append(r.pop())

print(sum(pq))
# Judge status: Accepted
#! /usr/bin/env python3

import sys
import numpy as np
int1 = lambda x: int(x) - 1
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

N, x, *A = map(int, read().split())
A = sorted(A)
cnt = 0

for a in A[:-1]:
    if x >= a:
        cnt += 1
        x -= a
if x == A[-1]:
    cnt += 1

print(cnt)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
A=sorted([abs(a-b),abs(b-c),abs(c-a)])
print('Yes' if A[1]<=d else 'No')
# Judge status: Accepted
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

from collections import Counter
c = Counter(a)
ans = 0
for k,v in c.items():
    if k>v:
        ans += v
    elif k<v:
        ans += (v-k)
print(ans)
# Judge status: Wrong Answer
N,K = map(int,input().split())
h = list(map(int,input().split()))

cost = [0]
for i in range(2,N+1):
    print(i)
    cost.append( min([cost[j] + abs(h[i-1]-h[j]) for j in range(max(0,i-K-1), i-1)]) )
print(cost)
# Judge status: Accepted
sx,sy,tx,ty = map(int,input().split())
going1 = ''
returning1 = ''
going2 = ''
returning2 = '' 
a = tx - sx
b = ty - sy
going1 ='U' * b + 'R' * a
returning1 = 'D' * b + 'L' * a
going2 = 'L' + 'U' * (b + 1) + 'R' * (a + 1) + 'D'
returning2 = 'R' + 'D' * (b + 1) + 'L' * (a + 1) + 'U'
print(going1 + returning1 + going2 + returning2)
# Judge status: Accepted
n = int(input())

# not 0, but 9 == not 9, but 0
#2 * (9 ** n - 8 ** n)

# not 0,9
#8 ** n

# ans = all - (not 0, but 9 + not 9, but 0) - not 0,9
print((10**n - 2 * (9 ** n - 8 ** n) - 8 ** n) %  (10**9 + 7))
# Judge status: Accepted
#import sys
#input = sys.stdin.readline
M = 10**9+7
n = int(input())
l = list(map(int,input().split()))
o = [0]*61
z = [0]*61
for i in l:
    a = bin(i)[2:]
    j = 0
    while(j < len(a)):
        if a[j] == "1":
            o[len(a)-j-1] += 1

        j += 1

cnt = 0
b = 1
for j in range(len(o)):
    cnt = (cnt+(o[j]*(n-o[j])*b)%M)%M
    b *= 2

print(cnt)
# Judge status: Wrong Answer
a,b=map(int,input().split())
c=0
if a >=10:
  print(b)
else:
  c = 100 * (10-a)
  print(c)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if b <= c or d <= a:
    ans = 0
elif a < c and c < b and b < d:
    ans = abs(b-c)
elif c < a and a < d and d < b:
    ans = abs(d-a)
elif a <= c and d <= b:
    ans = abs(d-c)
else:
    ans = b-a

print(ans)
# Judge status: Accepted
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n,k = na()
a = na()

for i in range(k,n):
    print('Yes' if a[i] > a[i-k] else 'No')
# Judge status: Wrong Answer
n, a, b = map( int, input().split() )
sum = 0
count = 1

while count <= n:
    c_tth = int(count/10000)
    c_th = int(count/1000 - c_tth*10000)
    c_hun = int(count/100 - c_tth*10000 - c_th*1000)
    c_ten = int(count/10 - c_tth*10000 - c_th*1000 - c_hun*100)
    c_o = int(count - c_tth*10000 - c_th*1000 - c_hun*100 - c_ten*10)

    c_check = c_tth + c_th + c_hun + c_ten + c_o

    if a <= c_check and b >= c_check:
        sum += count

    count += 1


print("{}".format(sum))