peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import numpy as np

N, D=list(map(int, input().split()))
point = []
for _ in range(N):
    point.append( list(map(int, input().split())) )
count=0
for X, Y in point:
    if np.sqrt( X**2+Y**2 ) <= D:
        count+=1
print(count)
# Judge status: Wrong Answer
S = input()
T = input()

for i in range(len(S)):
	print(S[i])
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().strip()
def resolve():
    n=int(input())
    l=[int(input()) for i in range(n)]
    l1=sorted(l,reverse=True)
    for j in range(n):
        if l[j]!=l1[0]:
            print(l1[0])
        else:
            print(l1[1])
resolve()
# Judge status: Accepted
S = input()
t = '2018' + S[4:]
print(t)
# Judge status: Accepted
# -*- coding: utf-8 -*-
A,B,N = map(int, input().split())
 
def function(x):
  return (A*x)//B-A*(x//B)
 
if B-1<=N:
  print(function(B-1))
else:
  print(function(N))
# Judge status: Accepted
a=int(input())
b=int(input())

c=[1,2,3]
c[a-1]=0
c[b-1]=0

print(max(c))
# Judge status: Wrong Answer
from collections import Counter

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

res = Counter(S[0])

for s in S[1:]:
    c = Counter(s)
    res = res & c

ans = ""
for key in res.keys():
    ans += key * res[key]

print(ans)
# Judge status: Wrong Answer
h, w = map(int, input().split())
hei = int(h / 2) if h % 2 == 0 else (int(h / 2) + 1)
# print(hei)
wid = int(h / 2) if h % 2 == 0 else int((h - 1) / 2)
# print(wid)

# print((w / 2) * (hei + wid))
# print(w % 2)
res = int(w / 2) * (hei + wid) if w % 2 == 0 else (int(w / 2) * (hei + wid)) + hei
print(res)
# Judge status: Accepted
n = int(input())
w = [input() for i in range(n)]
if all(n == len(set(w)) and w[i-1][-1] == w[i][0] for i in range(1,n)):
       print('Yes')
else:
       print('No')
# Judge status: Accepted
N = int(input())

for i in range(50000):
    if N == i*108//100:
        print(i)
        break
else:
    print(":(")
# Judge status: Accepted
N = int(input())
a = list(map(int,(input().split())))
a.sort(reverse=True)
ans = 0
for i in range(1,N*2,2):
    ans += a[i]
print(ans)
# Judge status: Accepted
n, k = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

ab.sort()

num_sum = 0

for a, b in ab:
    num_sum += b
    if num_sum >= k:
        print(a)
        exit()
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(500000)

print(chr(ord(read().decode('utf-8').rstrip()) + 1))
# Judge status: Wrong Answer
S = [i for i in list(input())]
k = ['k', 'e', 'y', 'e', 'n', 'c', 'e'] + ['_']*100
N = len(S)
m = 0;c=0
flag=False
for i in S:
    if i == k[m]:
        m+=1
        if flag:
            flag = False
    else:
        if not flag: c+=1
        flag=True

if c<=1 and m==6: print('YES')
else: print('NO')
# Judge status: Wrong Answer
from collections import Counter
N=int(input())
S=input()
mod = 10**9+7
d = Counter(S)
ans = 1
for v in d.values():
    ans *= v+1
print(ans-1)
# Judge status: Accepted
from collections import defaultdict

def f(x,y,z):
  return x**2 + y**2 + z**2 + x*y + y*z + z*x

N = int(input())

i = 1
dic = defaultdict(lambda: set())
dic[6].add((1,1,1))

while i <= N:
  if i in dic:
    print(len(dic[i]))
    for trio in dic[i]:
      x,y,z = trio
      dic[f(x,y,z+1)].add((x,y,z+1))
      dic[f(x,y+1,z)].add((x,y+1,z))
      dic[f(x+1,y,z)].add((x+1,y,z))
  else:
    print(0)
  i += 1
# Judge status: Accepted
import sys
n = int(input())
a = list(map(int, sys.stdin.readline().split()))
if n%2:
    print(" ".join(map(str, a[::-1][::2] + a[1::2])))
else:
    print(" ".join(map(str, a[::-1][::2] + a[::2])))
# Judge status: Wrong Answer
n = int(input())
a_li = list(map(int,input().split()))
low = a_li[0]
high = a_li[0]
old = a_li[0]
yen = 1000
for i in range(1,n):
    if low < a_li[i]:
        if old <= a_li[i]:
            high = a_li[i]
        else:
            div,yen = divmod(yen,low)
            yen += div*high
            low = a_li[i]
    old = a_li[i]
if low < high:
    div, yen = divmod(yen, low)
    yen += div * high
    low = a_li[i]
print(yen)
# Judge status: Wrong Answer
N, M, K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
AB = A + B
AB.sort()

x = 0
for i in range(N + M):
    if AB[i] <= K:
        x = x + 1
        K = K - AB[i]
        if K <= 0:
            break
        
print(x)
# Judge status: Accepted
n, k = map(int, input().split())
print(1 if n % k else 0)
# Judge status: Accepted
n, x, y = list(map(int, input().split()))
if n % x == 0:
    print((n // x) * y)
else:
    print((n // x + 1) * y)
# Judge status: Wrong Answer
S = list(input())
if S.count('A')==2 or S.count('B')==2:
    if S[0]==S[2]:
        print('Yes')
    else:
        print('No')
else:
    print('No')
# Judge status: Accepted
n=int(input())
l=[2,1]
for i in range(n-1):
    l.append(l[i]+l[i+1])

print(l[-1])
# Judge status: Accepted
l,r = map(int,input().split())
ans = 2019
r = min(r+1,l+2020)

for i in range(l,r):
    for j in range(i+1,r):
        ans = min(ans,i*j%2019)

print(ans)
# Judge status: Accepted
A = [[int(a) for a in input().split()] for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]

A.extend([[A[s][h] for s in range(3)] for h in range(3)])
A.append([A[s][s] for s in range(3)])
A.append([A[s][2-s] for s in range(3)])

flag_out = False
for i in range(8):
  flag = True
  for j in range(3):
    flag = (A[i][j] in B) & flag
  if(flag==True):
    print("Yes")
    flag_out = True
    break
if(flag_out==False):
  print("No")
# Judge status: Wrong Answer
N = int(raw_input())
d = map(int,raw_input().split())
ABC = []
ARC = []
ans = 0
for i in range(0,max(d)):
  for j in range(0,N):
    if d[j] >= i:
      ARC.append(d[j])
    else:
      ABC.append(d[j])
  if len(ABC) == len(ARC):
    ans = ans + 1
  ARC = []  
  ABC = []
print ans
# Judge status: Wrong Answer
from math import floor
print(eval('floor(int('+input().replace(' ',')*float(')+'))'))
# Judge status: Accepted
from sys import stdin
goukei = [int(x) for x in stdin.readline().rstrip().split()]
print(15 - sum(goukei))
# Judge status: Accepted
N = int(input())

count = 1#よくわからない、1とその数のぶんか？
for i in range(1, N-1):
  count += (N-1)//i
print(count)
# Judge status: Accepted
from itertools import accumulate
N,*A=map(int, open(0).read().split())
B=list(accumulate(A))
C=sum(A)
ans = float("inf")
for b in B[:-1]:
    ans=min(ans,max(b,C-b)-min(b,C-b))
print(ans)
# Judge status: Accepted
import math
from functools import reduce
n, x = map(int, input().split())
l = list(map(int, input().split()))


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

l_map = list(map(lambda a:abs(a-x), l))
print(gcd_list(l_map))
# Judge status: Accepted
import collections
N=int(input())
NUM=[i for i in range(1,N+1)]
H=list(map(int, input().split()))
L_NUM=[x+y for (x,y) in zip(NUM,H)]
R_NUM=[x-y for (x,y) in zip(NUM,H)]

L_dict=collections.Counter(L_NUM)
R_dict=collections.Counter(R_NUM)

ANS=0
for i in L_dict.keys():
    cnt=L_dict[i]*R_dict[i]
    ANS+=cnt
print(ANS)
# Judge status: Wrong Answer
H, N = map(int, input().split())
A = list(map(int, input().split()))
if H <= sum(A):
    print ('Yse')
else:
    print ('No')
# Judge status: Wrong Answer
n,A,B = map(int,input().split())
s = list(str(input()))
p =[]
for i in range(0,n):
  if s[i] =="c":
    print("No")
  elif s[i]=="a" or s[i]=="b":
    if A+B>len(p):
      if s[i] =="a":
        p.append(s[i])
        print("Yes")
      elif s[i]=="b":
        if p.count("b")<B:
          p.append(s[i])
        print("Yes")    
    else:
      print("No")
# Judge status: Accepted
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
print('Yes' if sum(B)-sum(A)>=sum(max(0,(b-a+1)//2) for a,b in zip(A,B)) else 'No')
# Judge status: Accepted
X,Y = list(map(int,input().split()))

if X==Y:
    print(0)
if X<Y:
    if X<0 and Y>0:
        print(1+abs(Y+X))
    else:
        print(Y-X)

if X>Y:
    if X>=0 and Y<=0:
        print(1+abs(X+Y))
    elif X>0 and Y>0:
        print(2+X-Y)
    elif X<0 and Y<0:
        print(2+X-Y)
    else:
        print(X-Y)
# Judge status: Accepted
import math

input = input().split()
h = int(input[0])
a = int(input[1])

answer = int(math.ceil(h / a))
print(answer)
# Judge status: Accepted
a, b, c, d = map(int, input().split())

if abs(a-c) <= d:
    print('Yes')
elif abs(a-b) <= d and abs(b-c) <= d:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a, b, c = map(int, input().split())

if (a==b and b==c):
    print("1")

elif (a==b and b!=c):
    print("2")

elif (a!=b and b==c ):
    print("2")

elif (a==c and b!=c):
    print("2")

elif (a!=c and b==c):
    print("2")

else: print("3")
# Judge status: Accepted
N = int(input())
X = list(map(int, input().split()))

def cost(p):
    res = 0
    for x in X:
        res += (x - p)**2
    return res

m = sum(X) // N
print(min(cost(m), cost(m+1)))
# Judge status: Wrong Answer
n, *a = map(int, open(0).read().split())
half_a = sum(a)//2
tmp = 0
ans = 0
for i in range(n):
    if tmp + a[i] >= half_a:
        ans = abs(tmp + a[i] - half_a) + abs(sum(a[i+1:]) - half_a)
        break
    tmp += a[i]
print(ans)
# Judge status: Accepted
n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)
# Judge status: Accepted
x=list(map(int, input().split()))
if x[0]<6:
	print(0)
elif x[0]>12:
	print(x[1])
else:
	print(x[1]//2)
# Judge status: Accepted
def resolve():
    a, b, k = map(int, input().split())
    t = []
    for i in range(1, min(a,b)+1):
        if a % i == 0 and b % i == 0:
            t.append(i)
    print(t[-k])
resolve()
# Judge status: Wrong Answer
n=int(input())
xy_1 = [0]*n
xy_2 = [0]*n
for i in range(n):
  x,y = map(int,input().split())
  xy_1[i] = x + y
  xy_2[i] = x - y

print(max(max(xy_1) - min(xy_1), max(xy_2)))
# Judge status: Accepted
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    a,b,c=map(int,input().split())
    if (a<c and c<b) or (b<c and c<a):
        print("Yes")
    else:
        print("No")

if __name__=='__main__':
    main()
# Judge status: Accepted
# A - Prefix and Suffix

N = int(input())
s, t = [input() for i in range(2)]
delta = N

for i in range(N):
    if s[i:] == t[:N-i]:
        delta = i
        break

print(N+delta)
# Judge status: Accepted
for l in sorted([s,-int(p),i+1] for s,p,i in [list(input().split())+[i] for i in range(int(input()))]): print(l[2])
# Judge status: Accepted
n=int(input())
import bisect
l=[1,6,9,36,81,216,729,1296,6561,7776,46656,59049]
def draw(x,y):
    ind=bisect.bisect_right(l,x)-1
    if ind==0:
        return y+x
    else:
        y += 1
        x1=x-l[ind]
        x2=x-l[ind-1]
        if x1==0 or x2==0:
            return y
        else:
            return(min(draw(x1,y),draw(x2,y)))
print(draw(n,0))
# Judge status: Accepted
lst = input().split()

N = int(lst[0])
M = int(lst[1])

students = []
checkpoints = []

for i in range(N):
   students.append(input().split())

for i in range(M):
   checkpoints.append(input().split())

def distance(P, Q):
   return abs(int(P[0]) - int(Q[0])) + abs(int(P[1]) - int(Q[1]))

for s in students:
   l1 = [10 ** 10]
   l2 = [0]
   for i in range(M):
      if distance(s, checkpoints[i]) < l1[-1]:
         l1.append(distance(s, checkpoints[i]))
         l2.append(i+1)
   print(l2[-1])
# Judge status: Wrong Answer
n = int(input())
s = input()

if n == 1:
    print('Yes')
else:
    if n % 2 == 0:
        head = s[:n // 2]
        tail = s[n // 2:]
    else:
        head = s[:n // 2]
        tail = s[n // 2 + 1:]

    if head == tail:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
N , M ,X = map(int,input().split())

L = []
for i in range(N):
  temp = list(map(int,input().split()))
  L.append(temp)

INF = float('inf')
ans = INF

for i in range(1,2**N):
  skill = [0 for i in range(M)]
  b = 0
  for j in range(N):
    if(i>>j)&1==1:
      b += L[j][0]
      for t in range(M):
        skill[t] += L[j][t+1]
  if all([skill[y] >= X for y in range(M)]):
    #print(skill)
    ans = min(ans,b)

if ans == INF:
  print(-1)
else:
  print(ans)
# Judge status: Wrong Answer
A,B,C = map(int, input().split())

i = abs((A-B)-C)

print(i)
# Judge status: Accepted
x,y=map(int,input().split())
A=[1,3,5,7,8,10,12]
B=[4,6,9,11]
C=[2]
def ans():
    while True:
        for l in A,B,C:
            if x in l and y in l:
                return 'Yes'
                break
        return 'No'
        break
print(ans())
# Judge status: Wrong Answer
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('Yes')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('No')
# Judge status: Accepted
a,b,c,d = map(int, input().split())

seki = []
seki.append(a*c)
seki.append(a*d)
seki.append(b*c)
seki.append(b*d)
seki = sorted(seki)
print(seki[-1])
# Judge status: Accepted
N, M = map(int, input().split())
st = [1 for _ in range(N+1)]
for _ in range(M):
    st[int(input())] = 0
dp = [0 for _ in range(N+1)]
MOD = int(1e9) + 7
dp[0] = 1
# DP
if st[1]:
    dp[1] = 1
for i in range(2, N+1):
    if st[i]:
        dp[i] = (dp[i-1] + dp[i-2]) % MOD
print(dp[-1])
# Judge status: Accepted
from bisect import bisect_left
n = int(input())
l = list(map(int, input().split()))
l.sort()
ans = 0
for i in range(n-2):
  for j in range(i+1, n-1):
    ans += bisect_left(l, l[i]+l[j], j+1, n) - j - 1
print(ans)
# Judge status: Accepted
a,b,c,d = map(int,input().split())
print(max(0,min(b,d)-max(a,c)))
# Judge status: Wrong Answer
s = input('')
n = len(s)
s1 = s[0:(n-1)//2]
s2 = s[(n+3)//2-1:]

if (s1 == s1[::-1] and s2 == s2[::-1]):
	print("Yes")
else:
  	print("No")
# Judge status: Accepted
N=int(input())
rates=list(map(int,input().split()))
colors=[]
over3200=0
for n in range(0,N):
    color=rates[n]//400
    if color<8:
        if not color in colors:
            colors.append(color)
    else:
        over3200+=1
if len(colors)==0:
    Min=1
else:
    Min=len(colors)
Max=len(colors)+over3200
print(Min,Max)
# Judge status: Accepted
n = int(input())
s = input()
t = input()

res = 0
s_ = s[::-1]
for i in range(n+1):
    tmp = s_[:i]
    tmp = tmp[::-1]
    
    cnt = 0
    for j in range(len(tmp)):
        if tmp[j] == t[j]:
            cnt += 1
    res = max(res, cnt)
print(2*n - res)
# Judge status: Wrong Answer
n,m = map(int, input().split())
if (n==m):
  print("yes")
else: 
  print("no")
# Judge status: Wrong Answer
def readinput():
    n=int(input())
    return n

def main(n):
    fk=[1]*(n+1)
    nn=n//2+1
    for i in range(2,nn+1):
        j=i
        while(j<=n):
            fk[j]+=1
            j+=i
    sum=0
    for i in range(1,n+1):
        sum+=i*fk[i]
    return sum

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)
# Judge status: Wrong Answer
X = int(input())

if 1800 <= X <=1990:
    print(1)
elif 1600 <= X <=1799:
    print(2)
elif 1400 <= X <=1599:
    print(3)
elif 1200 <= X <=1399:
    print(4)
elif 1000 <= X <=1199:
    print(5)
elif 800 <= X <=999:
    print(6)
elif 600 <= X <=799:
    print(7)
else:
    print(8)
# Judge status: Accepted
#54 A - Airport Bus
N,C,K = map(int,input().split())
T = [int(input()) for _ in range(N)]
T = sorted(T,reverse = False)

ans = 0
bus = 1
first = T[0]
for i in range(1,N):
    # T[i] がバスに乗ることができるとき
    if (bus < C) and (T[i] <= first + K):
        bus += 1
    # T[i] がバスに乗ることができないとき
    else:
        # 新しいバスの first になる
        ans += 1
        bus = 1
        first = T[i]
        
print(ans+1)
# Judge status: Wrong Answer
A,B,C = list(map(int,input().split()))
if A+B==C or A+C==B or B+C==A:
    print("YES")
else:
    print("NO")
# Judge status: Wrong Answer
a,b,x = map(int,input().split())
print('No' if a>x and a+b<x else 'Yes')
# Judge status: Accepted
k, a, b = map(int, input().split())
if k < a or a >= b - 1:
    print(k + 1)
elif k % 2 == a % 2:
    print((b - a) * ((k - a + 1) // 2) + a + 1)
else:
    print((b - a) * ((k - a + 1) // 2) + a)
# Judge status: Accepted
n,m = map(int,input().split())
l = []
for i in range(n):
    l.append(list(map(int,input().split())))
l = sorted(l)
p = 0
d = 0
i = 0
while(d < m):
    s = min(l[i][1],m-d)
    d += s
    p += l[i][0] * s
    i += 1
print(p)
# Judge status: Accepted
n,m = map(int,input().split())
import math
a_list = list(map(int,input().split()))
for i in range(n):
  a_list[i] = -1 * a_list[i]
import heapq
heapq.heapify(a_list)
for j in range(m):
  
  a = heapq.heappop(a_list)
  a = math.ceil(a/2)
  heapq.heappush(a_list,a)


print(-1 * sum(a_list))
# Judge status: Accepted
S = int(input())
# S = 10 ** 18 - 2
if S == 10 ** 18:
    x1 = 10 ** 9
    x2 = 0
else:
    x1 = (S // 10 ** 9) + 1
    x2 = 10 ** 9 - (S % 10 ** 9)
print(x1, 1, x2, 10 ** 9, 0, 0)
# Judge status: Wrong Answer
N = int(input())
a, b, c = 1, 1, 1
for i in range(N):
  a *= 10
  b *= 9
  c *= 8
  a %= 10**9+7
  b %= 10**9+7
  c %= 10**9+7
print(a-b*2+c)
# Judge status: Accepted
N, M = [int(a) for a in input().split()]
L = []
R = []

for _ in range(M):
    l, r = [int(a) for a in input().split()]
    L.append(l)
    R.append(r)

mingate = max(L)
maxgate = min(R)
ans = max(maxgate - mingate + 1, 0)
print(ans)
# Judge status: Wrong Answer
n = int(input())
a = list(map(int, input().split()))

count = 0
s = sum(a)
while(s % 2== 0 and s != 0):
  count+=1
  s = s//2
print(count)
# Judge status: Wrong Answer
D = {"SUN": "MON", "MON": "TUE", "TUE": "WED",
     "WED": "THU", "THU": "FRI", "FRI": "SAT", "SAT": "SUN"}
S = input()
print(D[S])
# Judge status: Accepted
S = input() 
m = len(S)//2
for i in range(len(S)):
    m -= 1
    if S[:m] == S[m:m*2]:
        print(m*2)
        break
# Judge status: Wrong Answer
n = int(input())
p = list(map(int, input().split()))

count=0
for name in range(len(p)-1):
  if (p[name+1] > p[name] > p[name-1]) or (p[name-1] > p[name] > p[name+1]):
    count+=1
print(count)
# Judge status: Accepted
N = int(input())
W = list(map(int, input().split()))

S = sum(W)

ans = S
c = 0
for i in range(N):
  c += W[i]
  S -= W[i]
  s = abs(S - c)
  ans = min(ans, s)

print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
if n >= m:
    print(0)
    exit()
x = sorted(map(int, input().split()))
l = sorted(i - j for i, j in zip(x[1:], x[:-1]))
print(sum(l[: m - n]))
# Judge status: Wrong Answer
a=str(input())
count=0
ans=0
for i in range(len(a)):
    if a[i]== 'A' or a[i]== 'C' or a[i]== 'G' or a[i]== 'T' :
        count+=1
    else:
        ans=max(ans,count)
        count=0
print(ans)
# Judge status: Wrong Answer
n, m = map(int, input().split())
ans = [0] * n
cklist = [0] * n
result = True
for x in range(m):
    s, c = map(int, input().split())
    if n != 1 and s == 1 and c == 0: 
        print(-1)
        result = False
        break
    elif cklist[s - 1] == 1 and ans[s - 1] != c:
        print(-1)
        result = False
        break
    else:
        ans[s - 1] = c
        cklist[s - 1] = 1
ans_str = [str(n) for n in ans]
if(result == True): print(''.join(ans_str))
# Judge status: Accepted
a, b = map(int, input().split())

if a == 1 and b == 1:
    print("Draw")
elif a == 1:
    print("Alice")
elif b == 1:
    print("Bob")
else:
    if a < b:
        print("Bob")
    elif a == b:
        print("Draw")
    else:
        print("Alice")
# Judge status: Wrong Answer
w, a, b = map(int, input().split())
if a + w < b:
    print(b-a-w)
elif a < b and b < a+w:
    print(0)
elif b < a+w and a < b:
    print(0)
elif b + w < a:
    print(a-b-w)
# Judge status: Accepted
def pin(type=int):
    return map(type,input().split())
X,=pin()

while(True):
    flag = 0
    l=int(X**0.5)
    for i in range(2,l+1):
        if X % i == 0:
            flag = 1
    if flag == 0:
        print(X)
        break
    else:
        flag = 0 
        X +=1
# Judge status: Accepted
X = input()
xlst = []
xlst.append(X[0])
for i in range(1, len(X)):
    if X[i] == 'S':
        xlst.append(X[i])
    else:
        if xlst != [] and xlst[-1] == 'T':
            xlst.append(X[i])
        elif xlst != [] and xlst[-1] == 'S':
            xlst.pop()
        else:
            xlst.append(X[i])

print(len(xlst))
# Judge status: Accepted
def main():
    N= int(input())
    a = list(map(int,input().split()))
    cnt = 0
    for i in range(0,N,2):
        if a[i] % 2 == 1:
            cnt += 1
    print(cnt)
if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
A, B, C, K = map(int, input().split())
ans = A-B if K % 2 == 0 else B-A
print(ans if abs(ans) <= 10**8 else 'Unfair')
# Judge status: Accepted
import sys
from itertools import accumulate
input=sys.stdin.buffer.readline
def main():
    n,k=map(int,input().split())
    a=[*map(int,input().split())]
    for _ in'_'*k:
        b=[0]*n
        for i,t in enumerate(a):
            if i>t:b[i-t]+=1
            else:b[0]+=1
            j=i-~t
            if j<n:b[j]-=1
        a=[*accumulate(b)]
        if min(a)==n:break
    print(' '.join(map(str,a)))
main()
# Judge status: Accepted
n = int(input())
arr = list(map(int, input().split()))
MOD = 10**9 + 7

ans = 0
for i in range(60):
    mask = 1 << i
    cnt = sum([1 for x in arr if x & mask == mask])
    ans += mask * cnt * (n - cnt) % MOD

print(ans % MOD)
# Judge status: Wrong Answer
N, HP = map(int, input().split())

K = []
A = []
B = []
for _ in range(N):
  a, b = map(int, input().split())
  B.append(b)
  A.append(a)
  
MA = max(A)
ans = 0
for b in sorted(B, reverse=True):
  HP -= b
  ans += 1
  if HP <= 0:
    print(ans)
    exit()
    
  if MA > b:
    break

c = HP // MA
ans += HP // MA

if HP - (c*MA) > 0:
  ans += 1

print(ans)
# Judge status: Accepted
n,d=map(int,input().split())
print((n+(d*2+1)-1)//(d*2+1))
# Judge status: Accepted
a, b, c = map(int, input().split())

n1 = a*b*(c-c//2)- a*b*(c//2)
n2 = c*b*(a-a//2)- c*b*(a//2)
n3 = a*c*(b-b//2)- a*c*(b//2)

print(min(n1, n2, n3))
# Judge status: Accepted
n=int(input())
ans=0
for i in range(1,n+1):
  if len(str(i))%2==1:
    ans+=1
print(ans)
# Judge status: Accepted
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
t, ans = sum(B), 0
j = M
for i in range(N+1):
   while j>0 and t>K:
       j -= 1
       t -= B[j]
   if t>K: break
   ans = max(ans, i+j)
   if i==N: break
   t += A[i]

print(ans)
# Judge status: Wrong Answer
N = int(input())
S = list(map(int,input().split()))
B = list(reversed(S))
B.sort()
count = 0
for i in range(len(S)):
    if S[i] != B[i]:
        count += 1
if count == 2 or count == 0:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
x,y=map(int,input().split())
lst=[]
lst.append(x)
for i in range(2,y):
    z=0
    z=lst[-1]*2
    if z>y or z>10**18:
        print(len(lst))
        break
    else:
        lst.append(z)
# print()
# Judge status: Wrong Answer
from collections import Counter

n = int(input())
d = list(map(int,input().split()))
MOD = 998244353
if d[0] != 0:
    print(0)
    exit()

else:
    cnt = Counter(d)

ans = 1
for i in range(1, n):
    ans *= pow(cnt[i-1], cnt[i], MOD) % MOD

if cnt[0] != 1:
    ans = 0
max_c = max(cnt)
for i in range(max_c + 1):
    if i not in cnt:
        ans = 0
print(ans)
# Judge status: Accepted
X = int(input())

if 360 % X == 0:
    print(360 // X)
    exit()
else:
    mod = 0
    cnt = 0
    while (360 + mod) % X != 0:
        cnt += (360 + mod) // X
        mod = (360 + mod) % X
    cnt += (360 + mod) // X

print(cnt)
# Judge status: Accepted
from string import ascii_lowercase as alph

def gen_pattern(N, pre="", m=0):
  if len(pre)+1 == N:
    for c in alph[:m+1]:
      yield pre+c
  else:
    for c in alph[:m]:
      yield from gen_pattern(N, pre+c, m)
    yield from gen_pattern(N, pre+alph[m], m+1)

for pattern in gen_pattern(int(input())):
  print(pattern)
# Judge status: Accepted
from decimal import Decimal

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

print(int(A*B))
# Judge status: Accepted
from collections import Counter 
n = int(input())
l = list(map(int, input().split()))
c = Counter(l)
ans = 0
for k, v in c.items():
    if k < v:
        ans += v - k
    elif k > v:
        ans += v
print(ans)