peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
N, P = map(int, input().split())
A = list(map(int, input().split()))
def comb(n, k):
  ret = 1
  for i in range(1, k+1):
    ret = ret * (n+1-i) // i
  return ret
Even = 0
Odd = 0
for a in A:
  if a % 2 == 0:
    Even += 1
  else:
    Odd += 1
ans = 0
while P <= Odd:
  ans += comb(Odd, P)
  P += 2
print(ans * 2 ** Even)
# Judge status: Accepted
from collections import defaultdict

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
a = readInts()
sum_a = sum(a)
v = sum(a)/2
ans = float("inf")
t = 0
for i in range(len(a)):
	t+=a[i]
	ans = min(ans,abs(sum_a-2*t))
print(ans)
# Judge status: Wrong Answer
w = input()
lis = []
for a in set(w):
  b = w.count(a)
  if b % 2 == 1:
    print("No")
    break
  else:
    lis.append(b)
if len(lis) == set(w):
  print("Yes")
# Judge status: Accepted
a,v=map(int,input().split())
b,w=map(int,input().split())
t=int(input())
if v-w <= 0:
    print('NO')
    exit()
ans=abs(a-b)/(v-w)
if ans <= t:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import math
a = input()
N = int(a)

X = N//1.08 + 1
x = math.floor(X*1.08)
if x == N:
    print(int(X))
else:
    print(':(')
# Judge status: Wrong Answer
import itertools as it

n = int(input())
p = tuple(map(int, input().split()))
q = tuple(map(int, input().split()))

r = list(it.permutations(range(1, n+1)))

a = 0
b = 0
for i in range(len(r)):
    if r[i] == p:
        a = i
    elif r[i] == q:
        b = i

print(abs(a-b))
# Judge status: Accepted
A,B = map(int, input().split())
print('Yay!' if A <= 8 and B <= 8 else ':(')
# Judge status: Accepted
#ABC151 A

C=input()
myord=1+ord(C)
print(chr(myord))
# Judge status: Accepted
a,b,c,k=map(int,input().split())
if a>=k:
  print(k)
elif a+b>=k:
  print(a)
else:
  print(2*a+b-k)
# Judge status: Wrong Answer
k , x = map(int,input().split())
print("Yes" if 500*k>x else "No")
# Judge status: Wrong Answer
a, b, c = input()
if "a" and "b" and "c" in (a + b + c):
  print("Yes")
else:
  print("No")
# Judge status: Accepted
N=int(input())
a=list(map(int,input().split()))
print(sum(i%2==1 for i in a[::2]))
# Judge status: Accepted
n, k = map(int, input().split())
l = [int(i) for i in range(n + 1)]
lr = l[::-1]

if k == n + 1:
    print(1)
else:
    ans = 1
    mod = 10**9 + 7
    left = sum(l[:k])
    right = sum(lr[:k])
    # print(left)
    # print(right)
    for i in range(n - k + 1):
        ans += right - left + 1
        ans %= mod
        left += l[k + i]
        right += lr[k + i]
    print(ans)
# Judge status: Accepted
import numpy as np
n = int(input())
a0 = np.array(list(map(int, input().split())))
a = a0.copy()
b = np.array(list(map(int, input().split())))
for i in range(n):
  c = a[i] - b[i]
  if c < 0:
    a[i] = 0
    a[i+1] = a[i+1] + c
    if a[i+1] < 0:
      a[i+1] = 0
  else:
    a[i] = a[i] - b[i]
print(sum(a0 - a))
# Judge status: Wrong Answer
A, B = map(int, input().split())
if(A<=9 and B<=9):
    print(int(A*B))
else:
    print()
# Judge status: Accepted
n=int(input())
al=list(map(int,input().split()))
s=1000
k=0
for i,j in zip(al,al[1:]):
    if i==j:
        continue
    if i<j:
        m=s//i
        k+=m
        s-=m*i
    else:
        s+=k*i
        k=0
s+=k*al[-1]
print(s)
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
ans = 1
flag = 0
for i in range(n):
    ans *= a[i]
    if ans > 1e18:
        flag = 1
        ans = 1
    if a[i] == 0:
        flag = 0
        ans = 0

if flag:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
N = input()
li = [int(i) for i in N]

print(sum(li))
# Judge status: Accepted
N = int(input())

A=[int(input()) for i in range(N)]

now=1
c=0

while c<N:
    now=A[now-1]
    c+=1
    if(now==2):
        print(c)
        break
else:
    print("-1")
# Judge status: Accepted
L = int(input())
print((L/3) ** 3)
# Judge status: Accepted
d,t,s=map(int,input().split())
if d<=s*t:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n=int(input())
blue=[input() for _ in range(n)]
m=int(input())
red=[input() for _ in range(m)]
l=list(set(blue))
print(max(0,max(blue.count(l[i])-red.count(l[i]) for i in range(len(l)))))
# Judge status: Accepted
a, b = map(int, input().split())
ans = 0
c = 1
while c < b:
  ans += 1
  c += a - 1
print(ans)
# Judge status: Accepted
N = int(input())
cnt = 0
for i in range(1,N+1):
  if len(str(i))%2 == 1:
    cnt += 1
print(cnt)
# Judge status: Wrong Answer
H,A=list(map(int,input().split()))

print(int(H/A)+1)
# Judge status: Accepted
N = int(input())
W = [int(s) for s in input().split()]

ans = 10**9
for i in range(N):
    s1 = sum(W[0:i])
    s2 = sum(W[i:])
    ans = min(abs(s1-s2), ans)

print(ans)
# Judge status: Wrong Answer
import collections
n = int(input())
l = []

for i in range(n):
    l.append(input())

l.sort()

c = collections.Counter(l)

print(c.most_common()[0][0])

for i in range(1, len(c)):
    if c.most_common()[0][1] == c.most_common()[i][1]:
        print(c.most_common()[i][0])
    else:
        break
# Judge status: Accepted
N,M,X = map(int,input().split())
K = []
for i in range(N):
    a = list(map(int,input().split()))
    K.append(a)

ans = 10**8
for i in range(2**N):
    c = 0
    skill = [0]*M
    for j in range(N):
        if ( (i>>j) & 1 ):
            c += K[j][0]
            for k in range(1,M+1):
                skill[k-1] += K[j][k]
    skill.sort()
    if skill[0] >= X:
        ans = min(c,ans)

if ans == 10**8:
    print(-1)
else:
    print(ans)
# Judge status: Wrong Answer
x = int(input())
if x<100:
  print(0)
else:
  n = x//100
  m = x%100
  
  dp = set([0,1,2,3,4,5])
  
  for i in range(n):
    t = set([])
    for dp_i in dp:
      for j in range(6):
      	t.add((dp_i+j)%100)
    dp = t 
  
  if m in dp:
    print(1)
  else:
    print(0)
# Judge status: Accepted
n = int(input())

A = list(map(int, input().split()))
t = 0
for i in range(n-2):
    if A[i:i+3][1] == sorted(A[i:i+3])[1]:
        t += 1
print(t)
# Judge status: Accepted
N = int(input())

h = [2, 4, 5, 7, 9]
p = [0, 1, 6, 8]
b = [3]

NN = N % 10
if NN in h:
    print('hon')
elif NN in p:
    print('pon')
else:
    print('bon')
# Judge status: Accepted
a, b = map(int, input().split())

if (a <= 0 and b >= 0) or (a >= 0 and b <= 0):
  print("Zero")
elif (a < 0 and b < 0):
  if (abs(a - b) + 1) % 2 == 0:
    print("Positive")
  else:
    print("Negative")
else:
  print("Positive")
# Judge status: Accepted
import numpy as np
import sys
import math

n=int(input())
A=np.array(sorted(list(map(int,input().split()))))
C=np.bincount(A)
D=C.copy()
D[1:]+=C[:-1]
D[:-1]+=C[1:]
print(np.max(D))
# Judge status: Accepted
import numpy as np
from collections import defaultdict

N = int(input())

arr = np.array(list(map(int, input().split())))
unique, cnts = np.unique(arr, return_counts=True)

counts = defaultdict(int)
sum = arr.sum()

for key, val in zip(unique, cnts):
    counts[key] = val

Q = int(input())

for i in range(Q):
    B, C = list(map(int, input().split()))
    counts[C] += counts[B]
    sum += counts[B] * (C - B)
    counts[B] = 0
    print(sum)
# Judge status: Wrong Answer
a,b,c,d=map(int,input().split())
hpa=a
hpc=c
while (hpa>0) and (hpc>0):
  hpc=hpc-b
  hpa=hpa-d
  
if hpa<=0:
  print("No")

if hpc<=0:
  print("Yes")
# Judge status: Wrong Answer
#累積和的な

n,q = map(int,input().split())
s = input() + 'A' 
li = [0]*(n+1)

for i in range(n):
  li[i+1] = li[i] + (1 if s[i] + s[i+1] == 'AC' else 0)
  
print(li)
for j in range(q):
  l,r = map(int,input().split())
  print(li[r-1] - li[l-1])
# Judge status: Accepted
print("NYoe s"["9" in input()::2])
# Judge status: Wrong Answer
x = int(input())

per11 = x // 11
remain_per11 = x % 11

if remain_per11 >= 6:
    print(per11*2 + 2)
else:
    print(per11*2 + 1)
# Judge status: Accepted
def main():
    N = int(input())

    temp = int(N / 10)
    temp = temp * 10
    result = None

    if (N- temp) == 2 or (N- temp) == 4 or (N- temp) == 5 or (N- temp) == 7 or (N- temp) == 9 :
        result = 'hon'
    elif (N- temp) == 3 :
        result = 'bon'
    else :
        result = 'pon'

    print(result)

if __name__ == "__main__":
    main()
# Judge status: Wrong Answer
def input_int_list():
    return [int(thing) for thing in input().split(" ")]
N,M=input_int_list()
ken_toshi=[input_int_list() for _ in range(M)]
ken_shinotoshi={i+1:sorted([thing[1] for thing in ken_toshi if thing[0]==i+1]) for i in range(N)}
ken_toshinum={i+1:0 for i in range(N)}
def normalize(num:int):
    return str(num).zfill(6)

for ken,toshi in ken_toshi:
    ans_left=normalize(ken)
    the_index=ken_shinotoshi[ken].index(toshi)
    ken_shinotoshi[ken].pop(the_index)
    ans_right=normalize(the_index+1+ken_toshinum[ken])
    print(ans_left+ans_right)
# Judge status: Accepted
s = input()

cnt = 0

for i in s:
    if i == '1':
        cnt += 1

print(cnt)
# Judge status: Accepted
N=int(input())
a = [str(input()) for i in range(N)]

b = list(set(a))
print(len(b))
# Judge status: Accepted
# ABC131 D Megalomania
import itertools

n = int(input())
ab_list = [[None] * 2 for i in range(n)]
for i in range(n):
    ab_list[i] = list(map(int, input().split()))

ab_list.sort(key=lambda x:(x[1]))
ab_list_T = [list(x) for x in zip(*ab_list)]

cum_iter = itertools.accumulate(ab_list_T[0])

flag = True
for i,_ in enumerate(cum_iter):
    if _ > ab_list_T[1][i]:
        flag = False
    
if flag:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
N=int(input())
A=list(map(int,input().split()))
p=0
for i in range(N):
  A[i]=A[i]-i-1
  p+=A[i]
A.sort()
ans=0
a=p//N-1
b=p//N
c=p//N+1
d=0
e=0
f=0
for i in range(N):
  d+=abs(A[i]-a)
  e+=abs(A[i]-b)
  f+=abs(A[i]-c)
print(min(d,min(e,f)))
# Judge status: Accepted
n,m=map(int,input().split())
x=sorted(list(map(int,input().split())))
if m<=n:
  print(0)
else:
  d=[]
  for i in range(m-1):
    d.append(x[i+1]-x[i])
  d=sorted(d)
  print(sum(d[:m-n]))
# Judge status: Accepted
# -*- coding: utf-8 -*-
N, K = input().split()
p = sorted(map(int, input().split()))
print(sum(p[0:int(K)]))
# Judge status: Accepted
print("YES" if int(input()) in [3,7,5] else "NO")
# Judge status: Accepted

import fractions

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

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

a = (B // C) - ((A-1) // C)
b = (B // D) - ((A-1) // D)
c = (B // (lcm(C, D))) - ((A-1) // (lcm(C, D)))

s = a + b - c

ans = B - (A-1) - s

print(ans)
# Judge status: Accepted
n=int(input())
p=list(map(int,input().split()))
cnt=0
tiny=float('inf')

for i in range(n):
  if tiny>=p[i]:
    cnt+=1
    tiny=p[i]
  else:
    pass
    
print(cnt)
# Judge status: Wrong Answer
alphabet = [chr(ord('a') + i) for i in range(26)]
s = list(input())
s = list(set(s))
s.sort()
for i in range(len(s)):
    if s[i] == alphabet[i] and i != len(s) - 1:
        pass
    else:
        print(alphabet[i])
        exit()
print("None")
# Judge status: Accepted
n,m=map(int,input().split())
l=[list(map(int,input().split())) for _ in range(m)]

arr=[str(i) for i in range(10**(n-1) if n>1 else 0,10**n)]

for x in arr:
  for i,tmp in enumerate(l):
    s,c=tmp
    if x[s-1]!=str(c):
      break
  else:
    print(x)
    exit()

print(-1)
# Judge status: Wrong Answer
l, r, x = map(int, input().split(' '))

ans = r // x - (l-1) // x
# Judge status: Accepted
a,b,c = map(int,input().split())
count = 0
flag = True
while(a % 2 == 0 and b % 2 == 0 and c % 2 == 0):
    aa = a//2
    bb = b//2
    cc = c//2
    a = bb + cc
    b = aa + cc
    c = aa + bb
    if(a == b == c):
        flag = False
        break
    count += 1

if flag:
    print(count)
else:
    print(-1)
# Judge status: Accepted
s = input()
t = input()

for i in range(len(s)):
    if s[i:]+s[:i] == t:
        print('Yes')
        exit()
print('No')
# Judge status: Wrong Answer
n = int(input())

A = list(input())

import collections

C = collections.Counter(A)

t = 1

for i in C.values():
    t *= (i+1)
print(t - 1)
# Judge status: Wrong Answer
k,n=map(int,input().split())
a=list(map(int,input().split()))
a.append(a[0])
dis=[]
for i in range(n):
    d=abs(a[i]-a[i+1])
    if d>k/2:
        d=k-d
    dis.append(d)
print(dis,k-max(dis))
# Judge status: Wrong Answer
s = input()
print('Yes') if len(set(list(s))) == len(s) else print('No')
# Judge status: Accepted
K = int(input())
S = input()
if len(S) > K:
    S = S[:K] + '...'
print(S)
# Judge status: Accepted
a, b = map(int, input().split())
if a<= 8 and b <= 8:
    print('Yay!')
else:
    print(':(')
# Judge status: Accepted
s = int(input())
ans = [s]
i = 1
if s == 1 or s == 2:
    ans = 4
else:
    while ans[i-1] != 4:
        if ans[i-1] % 2 ==0:
            ans.append(ans[i-1]//2)
        else:
            ans.append(ans[i-1]*3 + 1 )
        i += 1
    ans = i + 3
print(ans)
# Judge status: Accepted
n=int(input())
s=0
l=[]
for i in range(1,n+1):
 s+=i
 l.append(i)
 if s>=n:
  for j in l:
   if j!=s-n:
    print(j)
  break
# Judge status: Accepted
n = int(input())
a = [int(input()) for _ in range(n)]

cnt = 0
idx = 0
flg = False
for _ in range(n):
    k = a[idx]
    idx = k-1
    cnt += 1
    if idx == 1:
        flg = True
        break
        
if flg:
    print(cnt)
else:
    print(-1)
# Judge status: Accepted
a, b = input().split()
A, B = map(int,input().split())
c = input()

if a == c:
    print(A - 1, B)
else:
    print(A, B - 1)
# Judge status: Accepted
#!/usr/bin/env python3
import sys


def solve(X: int, A: int, B: int):
    print("delicious" if A >= B else "safe" if A + X >= B else "dangerous")


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    X = int(next(tokens))  # type: int
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(X, A, B)


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
s, w = map(int, input().split())
if s >= w:
    print("safe")
else:
    print("unsafe")
# Judge status: Accepted
#A
n,k = map(int,input().split())
s = list(input())

s[k-1] = s[k-1].lower()

print("".join(s))
# Judge status: Wrong Answer
k = int(input())
if k%2:
    print((k//2)*((k//2)+1))
else:
    print((k/2)**2)
# Judge status: Accepted
A, B, M = map(int, input().rstrip().split(' '))
a = list(map(int, input().rstrip().split(' ')))
b = list(map(int, input().rstrip().split(' ')))
coupon = []

for i in range(M):
  x, y, c = map(int, input().rstrip().split(' '))
  temp = a[x-1]+b[y-1]-c
  coupon.append(temp)

min_price = min(coupon)

if min(a)+min(b) < min_price :
  print(min(a)+min(b))
else:
  print(min_price)
# Judge status: Accepted
a,b=map(int,input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print('Possible')
else:
  print('Impossible')
# Judge status: Accepted
N = int(input())
[*h] = map(int, input().split())
dp = [0 for _ in range(N)]
dp[1] = abs(h[0]-h[1])
for i in range(2, N):
    dp[i] = min(dp[i-1]+abs(h[i]-h[i-1]), dp[i-2]+abs(h[i]-h[i-2]))
 
print(dp[N-1])
# Judge status: Wrong Answer
a = input()
count = 0
for i in a:
  if i == 1:
    count += 1
print(count)
# Judge status: Accepted
S=input()
T=input()

d = {}
d2 = {}
for i in range(len(S)):
  if not d.get(S[i]):
    d[S[i]] = T[i]
  elif d[S[i]] != T[i]:
    print('No')
    exit()
  if not d2.get(T[i]):
    d2[T[i]] = S[i]
  elif d2[T[i]] != S[i]:
    print('No')
    exit()

print('Yes')
# Judge status: Accepted
# ABC061c
from collections import deque
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

n, k = map(int, input().split())
nums = [list(map(int, input().split())) for _ in range(n)]
nums.sort()
i = 0
for a, b in nums:
    i += b
    if i >= k:
        print(a)
        exit(0)
# Judge status: Accepted
# C
n = int(input())
a = [int(input()) for i in range(n)]
maxa = [-1,0]
premaxa = [-1,-1]
for i,num in enumerate(a):
    if num >= maxa[1]:
        premaxa = [maxa[0], maxa[1]]
        maxa = [i,num]
    elif num > premaxa[1]:
        premaxa = [i,num]
for i in range(n):
    if i == maxa[0]:
        print(premaxa[1])
    else:
        print(maxa[1])
# Judge status: Accepted
joint = input().replace(" ", "")
num = int(joint)
root = num**(1/2)
# print(root)
# print(root.is_integer())
print("Yes" if root.is_integer() else "No")
# Judge status: Accepted
N = int(input())

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

for i in range(N,10**6):
    if is_prime(i):
        print(i)
        exit(0)
# Judge status: Accepted
n = int(input())
a = list(map(int,input().split()))
a.sort(reverse=True)
b = []
g = []
for i in range(1,n):
    if a[i-1] == a[i]:
        b.append(a[i])
if 4 <= n:
    for i in range(3,n):
        if a[i-3] == a[i]:
            g.append(a[i])
c = sorted(list(set(b)),reverse=True)
f = sorted(list(set(g)),reverse=True)
ans = 0
if len(f):
    ans = max(ans,f[0]*f[0])
if 2 <= len(c):
    ans = max(ans,c[0]*c[1])
print(ans)
# Judge status: Accepted
N=int(input())
v=[int(i) for i in input().split()]
v.sort()
avg=v[0]
for i in range(1,N):
    avg=(v[i]+avg)/2
print(avg)
# Judge status: Wrong Answer
N=int(input())
A=[]
min_x=10**9+1
min_y=10**9+1
B=[0 for i in range(N)]
for i in range(N):
    x,y=map(int,input().split())
    A.append([x,y])
    min_x=min(min_x,x)
    min_y=min(min_y,y)
for i in range(N):
    A[i][0]=A[i][0]-min_x
    A[i][1]=A[i][1]-min_y
    B[i]=A[i][0]+A[i][1]
print(max(B)-min(B))
# Judge status: Wrong Answer
S = input()

res = 0
tmp = ""
last = ""

for s in S:
    tmp += s
    if tmp == last:
        continue

    print(tmp)
    last = tmp
    tmp = ""
    res += 1

print(res)
# Judge status: Accepted
class Counter(dict):
  def __missing__(self, i):
    return 0

n = int(input())

s = Counter()

for _ in range(n):
  i = input()
  s[i] += 1

s = dict(sorted(s.items(), key=lambda x: -x[1]))
m = max(list(s.values()))

ans = []
for i in s:
  if s[i] == m:
    ans.append(i)

ans.sort()

print('\n'.join(ans))
# Judge status: Wrong Answer
N = int(input())

result = [0] * N
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            temp = pow(x+y, 2) + pow(y+z, 2) + pow(z+x, 2)
            n = temp / 2
            if not n.is_integer():
                continue
            n = int(n)
            if n >= N:
                break
            result[n-1] += 1

for r in result:
    print(r)
# Judge status: Accepted
import itertools
import functools
import math
from collections import Counter
from itertools import combinations
import re


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

flg = 0
for i in range(N):
    if A[i] % 2 == 0:
        if not ( A[i] % 3 == 0 or A[i] % 5 == 0 ):
            flg = 1
            break

if flg == 1:
    print('DENIED')
else:
    print('APPROVED')
# Judge status: Wrong Answer
# #!/usr/bin/env python3
# # -*- coding: utf-8 -*-


def main():
    S = input()

    first = int(S[:2])
    second = int(S[2:])

    if first == 0 or second == 0:
        print('NA')
    elif first > 12 and second > 12:
        print('NA')
    elif first > 12 and second <= 12:
        print('YYMM')
    elif first <= 12 and second > 12:
        print('MMYY')
    else:
        print('AMBIGUOUS')


if __name__ == "__main__":
    main()
# Judge status: Accepted
T = input()

T = T.split('?')
ans = ''
for i in range(len(T)):
    ans = ans + T[i]
    if i != len(T)-1:
        ans += 'D'

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

ans = 3*(10**5)
to_east = 0
to_west = s.count('E', 1)
for i in range(1, n):
  if s[i]=='W':
    to_east += 1
  if s[n-i]=='E':
    to_west -= 1
  ans = to_east+to_west if ans>to_east+to_west else ans
  
print(ans)
# Judge status: Wrong Answer
n = int(input())

if n == 1:
    print(1)
else:
    if n % 2 == 0:
        print(n//2-1)
        print(n//2+1)
    else:
        print(n//2)
        print(n//2+1)
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N):
    if (i+1)%2 == 1 and A[i]%2 == 1:
        ans += 1
print(ans)
# Judge status: Accepted
N, T = map(int, input().split())
ans = float('inf')
for i in range(N):
    c, t = map(int, input().split())
    if t <= T:
        ans = min(ans, c)
print(ans if ans != float('inf') else 'TLE')
# Judge status: Wrong Answer
def solve(way, height, n):
  ss = set()
  for a,b in way:
    if height[a-1] == height[b-1]:
      ss = ss | {a,b}
    else:
      remove_idx = a if height[a-1] < height[b-1] else b
      ss = ss | {remove_idx}
  return n - len(ss)


if __name__ == "__main__":
  n,m = map(int, input().split())
  height = [int(i) for i in input().split()]
  way = [tuple(map(int, input().split())) for i in range(m)]
  print(way)
  print(solve(way, height, n))
# Judge status: Wrong Answer
x = [i for i in range(1, int(input())) if i%3!=0 and i%5!=0]
print(sum(x))
# Judge status: Wrong Answer
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
mix = sorted(A + B)
temp_sum = 0
goal = 0
for i in range(len(mix)):
    temp_sum += mix[i]
    goal = i
    if temp_sum > K:
        print(i)
        exit()
print(goal + 1)
# Judge status: Accepted
N = int(input())
sp_list = []
sorted_list = []
for i in range(N):
  S,P = map(str, input().split(' '))
  sorted_list.append([S,int(P)])
  sp_list.append(S + ' ' + P)
sorted_list = sorted(sorted_list, key=lambda x:(x[1]), reverse=True)
sorted_list = sorted(sorted_list, key=lambda x:(x[0]))

for i in range(N):
  count=1
  for j in range(N):    
    if sorted_list[i][0]+' '+str(sorted_list[i][1]) ==sp_list[j]:
      print(count)
      break
    count+=1
# Judge status: Accepted
a=list(map(int, input().split()))
a.sort()
print(10*a[2]+a[1]+a[0])
# Judge status: Wrong Answer
X,Y = map(int, input().split())
print(X + Y/2)
# Judge status: Accepted
n=int(input())
x=n*800
y=n//15*200
print(x-y)
# Judge status: Accepted
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))
from bisect import bisect
from itertools import accumulate

n,x=nii()
a=lnii()
a.sort()

b=list(accumulate(a))

if b[-1]<x:
  print(n-1)
else:
  inx=bisect(b,x)
  print(inx)
# Judge status: Accepted
n = int(input())
x = list(map(int,input().split()))
for i in range(n):
    x[i]-=i+1
x.sort()
if n%2==0:
    b = (x[n//2-1]+x[n//2])//2
else:
    b = x[(n-1)//2]
ans=0
for i in range(n):
    ans+=abs(x[i]-b)
print(ans)
# Judge status: Accepted
rgb = input().replace(' ', '')
if int(rgb) % 4 == 0:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
count = 0
x = int(input())
bal = 100
while bal<x:
    count+=1
    bal = int(bal*(1.01))
print(count)
# Judge status: Accepted
n = int(input())

ans = float("inf")
a, b = 0, 0
while True:
    a += 1
    b = n - a

    if b <= 0:
        break

    ans = min(ans, sum(map(lambda x: int(x), str(a))) + sum(map(lambda x: int(x), str(b))))

print(ans)
# Judge status: Accepted
import numpy as np

a = input()
a, b = a.split()
a = int(a)
if int(b) == 0:
  print(a)
  exit()
n = input()
n = [int(i) for i in n.split()]
li = list(range(-250, 250))
for i in n:
  li.remove(i)
mini = [np.inf, 0]
for i in li:
  if abs(i - a) == mini[0]:
    if i < mini[1]:
      mini = [abs(i - a), i]
  elif abs(i - a) < mini[0]:
    mini = [abs(i - a), i]
print(mini[1])
# Judge status: Accepted
N=int(input())
A=[int(i) for i in input().split()]
from itertools import accumulate

A=list(accumulate(A))
max_= float("inf")

for a in A[:-1]:
    max_=min(max_,abs(A[-1]-2*a))
print(max_)
# Judge status: Accepted
a,b,c=map(int,input().split())

print(c,a,b)
# Judge status: Accepted
import bisect
n,*l = map(int,open(0).read().split())
l.sort()
ans = 0
for i in range(n-2):
  for j in range(i+1,n-1):
    ans += bisect.bisect_left(l,l[i]+l[j],j+1)-bisect.bisect_right(l,abs(l[i]-l[j]),j+1)
print(ans)
# Judge status: Accepted
import math

N = int(input())

ans = 0

for i in range(1,N):
    temp = math.ceil((N/i)-1)
    ans += temp

print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
alis = list(int(input()) for _ in range(m))
dp = [-1]*(n+1)
for i in alis:
    dp[i] = 0
dp[0] = 1
dp[1] = 1
for i in range(2,n+1):
    if dp[i] == -1:
        dp[i] = dp[i-1] + dp[i-2]
print(dp[n]%1000000007)