peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Wrong Answer
n = int(input())
l = list(map(int, input().split()))
l.sort()
c = 0
for i in range(n - 2):
    x = l[i]
    for j in range(i + 1, n - 1):
        y = l[j]
        for k in range(j + 1, n):
            if x + y <= l[k]:
                break    
        c += k - j - 1
print(c)
# Judge status: Accepted
sx, sy, tx, ty = map(int, input().split())
ans = ""
for i in range(sx, tx): ans += 'R'
for i in range(sy, ty): ans += 'U'
for i in range(sx, tx): ans += 'L'
for i in range(sy, ty): ans += 'D'
ans += 'D'
for i in range(sx, tx + 1): ans += 'R'
for i in range(sy - 1, ty): ans += 'U'
ans += 'LU'
for i in range(sx - 1, tx): ans += 'L'
for i in range(sy, ty + 1): ans += 'D'
ans += 'R'
print(ans)
# Judge status: Wrong Answer
n,k=map(int, input().split())
h=[]
for i in range(n):
  h.append(int(input()))
h.sort()
ans=h[k-1]-h[0]
for i in range(1,n-k):
  ans=min(ans,h[i+k-1]-h[k])
print(ans)
# Judge status: Accepted
import sys
import math

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

sys.setrecursionlimit(1000000)
input = lambda: sys.stdin.readline().rstrip()

N, M = map(int, input().split())
a = list(map(lambda x : int(x) // 2, input().split()))
lcm = 1
for i in a:
    lcm = lcm * i // gcd(lcm, i)
ok = True
for i in a:
    if lcm // i % 2 == 0:
        ok = False

if not ok:
    print(0)
else:
    print((M // lcm - 1) // 2 + 1)
# Judge status: Accepted
x,y = map(int,input().split())
#if (2*x)<y:
z=y-(2*x) #12本足りない z=12
a=z/2 #a=6 亀に変身する鶴の数

if a<=x and a>=0 and z%2==0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n, m, k = map(int, input().split())

cant = True
for i in range(n+1):
    for j in range(m+1):
        if n*i+m*j-2*i*j==k: cant = False
print("YNeos"[cant::2])
# Judge status: Accepted
N,M = map(int,input().split())
x = set()
y = set()
 
for m in range(M):
    a,b = map(int,input().split())
    if a==1:
        x.add(b)
    if b==N:
        y.add(a)

if x&y:
    print("POSSIBLE")
else:
    print("IMPOSSIBLE")
# Judge status: Accepted
S=input()
m=0
count=0
for s in S:
    if s in "ACGT":
        count += 1
    else:count=0
    m=max(m,count)
print(m)
# Judge status: Wrong Answer
n,y=map(int,input().split())
flag=True

for i in range(n+1):
    for j in range(n+1-i):
        k=n-i-j
        if 10000*i+5000*j+1000*k==y:
            print(i,j,k)
            flag=False
            break

if flag==False:
    print(-1,-1,-1)
# Judge status: Accepted
import math
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
x = math.ceil(a / 10)
x += math.ceil(b / 10)
x += math.ceil(c / 10)
x += math.ceil(d / 10)
x += math.ceil(e / 10)
rems = [r for r in [a%10, b%10, c%10, d%10, e%10] if r != 0]
if len(rems) > 0:
    ans = 10*(x-1) + min(rems)
else:
    ans = 10*x
print(ans)
# Judge status: Accepted
def main():
    N = int(input())
    words = []
    success = True
    for _ in range(N):
        word = input()
        if word in words:
            success = False
        if not words == []:
            if not words[-1][-1] == word[0]:
                success = False
        words.append(word)
    if success:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()
# Judge status: Accepted
A, B, C, D = map(int, input().split())

c = C
d = D

gcd = 0
while gcd == 0:
  if c > d:
    k = c
    c = d
    d = k # 必ず c <= d になる
  if d%c == 0:
    gcd = c
  else:
    d = d%c

# 最小公倍数（lcm）
lcm = int(C*D/gcd)

wareru = B//C + B//D - B//lcm - (A-1)//C - (A-1)//D + (A-1)//lcm
ans = B-A+1-wareru
print(ans)
# Judge status: Accepted
date = list(input())
date[3] = "8"
print("".join(map(str, date)))
# Judge status: Accepted
def main():
    n,k = map(int,input().split())
    D = set(map(int,input().split()))

    while True:
        flg = 0
        for i in str(n):
            i = int(i)
            if i in D:
                flg = 1
                break
        if flg == 0:
            break
        n+=1

    print(n)

main()
# Judge status: Accepted
s = input()
x = ""
y = ""
x_con = 0
y_con = 0
for i in range(len(s)):
  if i % 2 == 0:
    x += "0"
    y += "1"
  else:
    x += "1"
    y += "0"

for i in range(len(s)):
  if s[i] != x[i]:
    x_con += 1
  if s[i] != y[i]:
    y_con += 1
  
print(min(x_con, y_con))
# Judge status: Accepted
n = int(input())
P = ["D"] + list(map(int,input().split()))

ans = 0
for i in range(1,n):
    if P[i] == i:
        ans += 1
        P[i+1] = P[i]
if P[-1] == n:
    ans += 1
print(ans)
# Judge status: Accepted
import math
import time
from collections import deque
from copy import deepcopy

t = time.time()
def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    n = iip()

    if n == 0:
        print(0)
        exit()
    if n % 2 == 1:
        print(0)
        exit()

    ret = int(0)

    num = 10
    while num <= n:
        ret += n // num
        num *= 5

    print(int(ret))


main()
# Judge status: Accepted
import collections
N = int(input())
A = list(map(int,input().split()))
C = collections.Counter(A)
keys = sorted(C.keys())
MAX = 0
for i in keys:
    MAX = max(MAX,C[i-1]+C[i]+C[i+1])
print(MAX)
# Judge status: Wrong Answer
import math
N = int(input())
S = math.ceil(N / 1.08)
if S * 1.08 != N:
  print(":(")
else:
  print(S)
# Judge status: Accepted
s=input()
n=len(s)
ans=0
for i in range(n):
    for j in range(i,n):
        if all('ACGT'.count(c)==1 for c in s[i:j+1]):
            ans=max(ans,len(s[i:j+1]))
print(ans)
# Judge status: Accepted
def main():
    n = int(input())
    A = [int(e) for e in input().split()]

    s = 0
    for a in A:
        s ^= a

    print(*[s ^ a for a in A])


if __name__ == '__main__':
    main()
# 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)]
def d(x,y):
    return abs(x[0]-y[0])+abs(x[1]+y[1])
for i in a:
    ans=10101001010
    ch=0
    for j in range(m):
        if d(i,c[j])<ans:
            ch=j
            ans=d(i,c[j])
    print(ch+1)
# Judge status: Accepted
N,M=map(int,input().split())
sc=[list(map(int,input().split())) for m in range(M)]
for i in range(10**N):
    if len(str(i))==N and all(str(i)[s-1]==str(c) for s,c in sc):
        print(i)
        break
else:
    print(-1)
# Judge status: Accepted
s = int(input())

points = s//500 * 1000
s = s %500
points += s //5 * 5
print(points)
# Judge status: Wrong Answer
import sys
a=str(input())
if a=="SUN":
    print(0)
elif a=="MON":
    print(6)     
elif a=="TUE":
    print(5)
elif a=="WED":
    print(4)
elif a=="THU":
    print(3)
elif a=="FRI":
    print(2)
else :
    print(1)
# Judge status: Wrong Answer
n, m = map(int, input().split())
l = 0
r = float('inf')
for i in range(m):
    li, ri = map(int, input().split())
    lb, rb = True, True
    if l < li and li <= r:
        l = li
    else:
        lb = False
    if r > ri and ri >= l:
        r = ri
    else:
        rb = False
    if not (lb or rb):
        print(0)
        exit()
    # print(l,r)

print(r - l + 1)
# Judge status: Accepted
s = input()
ans1=s[0]

def solve(i,tmp,ans):
  global ans1
  if i==3:
    if tmp==7:
      ans1=ans
      return True
    else:
      return False
  
  if solve(i+1,tmp+int(s[i+1]),ans+"+"+s[i+1]): return True
  if solve(i+1,tmp-int(s[i+1]),ans+"-"+s[i+1]): return True

if solve(0,int(s[0]),ans1):
  print(ans1+"=7")
# Judge status: Wrong Answer
N = int(input())
S = str(input())
num =int( N / 2)

f = S[0:num]

if S == f+f:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
a = list(map(int, input().split()))

a.sort()
print(a[2] * 10 + a[1] + a[0])
# Judge status: Wrong Answer
if __name__ == "__main__":
    a, b, c = map(int, input().split())

    if a == b == c:
        print(-1)
        exit()

    ans = 0
    while a % 2 == 0 and b % 2 == 0 and c % 2 == 0:
        a_tmp = (b+c)//2
        b_tmp = (a+c)//2
        c_tmp = (c+a)//2
        a = a_tmp
        b = b_tmp
        c = c_tmp
        ans += 1

    print(ans)
# Judge status: Accepted
N = int(input())
cmin = N
for i in range(1,N):
    j = N-i
    a = str(i)
    b = str(j)
    cnt = 0
    for k in range(len(a)):
        cnt += int(a[k])
    for k in range(len(b)):
        cnt += int(b[k])
    cmin = min(cmin,cnt)
print(cmin)
# Judge status: Accepted
n,k  = map(int,input().split())
a = list(map(int,input().split()))
ans = (n+k-3)//(k-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()))

a , b = [0] , [0]
for i in range(N):
    a.append(a[i]+A[i])
for j in range(M):
    b.append(b[j]+B[j])

ans , j = 0 , M
for i in range(N+1):
    if(a[i]>K):
        break
    while b[j] > K - a[i]:
        j -= 1
    ans = max(ans , i+j)
   
print(ans)
# Judge status: Accepted
s=list(input())
t=input()
k=[]
for i in range(len(s)-len(t)+1):
  m=i
  for j in t:
    if s[m]==j or s[m]=='?':
      m+=1
    else:break
  else:
    l=s[:i]+list(t)+s[i+len(t):]
    for i in l:
      if i=='?':
        l[l.index(i)]='a'
    k.append(''.join(l))
if len(k)==0:
  k.append('UNRESTORABLE')
print(min(k))
# Judge status: Wrong Answer
s = int(input())

def primeNumberCreate():
    global s
    primeList = [2]  # 2以下の素数リストを作成
    maxNumber = s+1000 # 1000以下の数字をチェック
    for x in range(s, maxNumber):
        for y in primeList:
            if x % y == 0:
                break
        else:
            primeList.append(x)  # 割り切れるものがなければリストに追加
    primeList.pop(0)
    return primeList

print(min(primeNumberCreate()))
# Judge status: Accepted
n = int(input())
a = list(map(int, input().split()))
m = 1000
i = 0
while i < n - 1:
    for j in range(i + 1, n):
        if a[i] < a[j]:
            m = m // a[i] * a[j] + m % a[i]
            i = j
        else:
            i = j
            break
print(m)
# Judge status: Accepted
Q,H,S,D=map(int,input().split())
N=int(input())
min1 = min(4*Q, 2*H, S)
min2 = min(8*Q, 4*H, 2*S, D)
if N%2==0:
    print(N//2*min2)
else:
    print(N//2*min2 + min1)
# Judge status: Wrong Answer
a,b,x=map(int,input().split())
if a>x and a+b>x:
    print('YES')
else:
    print('NO')
# Judge status: Wrong Answer
d, t, s = list(map(int, input().split()))
if d//s <= t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
import math
a, b = map(int, input().split())
print(math.ceil((a+b)/2))
# Judge status: Wrong Answer
N,M = map(int,input().split())
l = [list(map(int,input().split())) for i
     in range(N)]
for i in range(N):
  del l[i][0]

for i in range(N-1):
    a = set(l[i])&set(l[i+1])
    l[i+1] = a
    if N==1:
       print(len(l[0])) 
    print(len(a))
# Judge status: Accepted
def InnerRating(N, R):
  if N >= 10:
    return R
  else:
    return R + 100 * (10 - N)
  
N, R = map(int, input().split())
print (InnerRating(N, R))
# Judge status: Wrong Answer
n = int(input())
a = [int(input()) for _  in range(n)]


d = {}
for i in a:
    if i not in d:
        d[i] = 0
        d[i] +=1
    elif i in d:
        d[i] -=1
        
        
l =[]
for i in d.keys():
    if d[i] != 0:
        l.append(d[i])
print(len(l))
# Judge status: Accepted
n = int(input())

a = [0] * (n+1)
a[0] = 2
a[1] = 1

for i in range(2, n+1):
    a[i] = a[i-1] + a[i-2]

# print(a)
print(a[n])
# Judge status: Accepted
from collections import deque
S = input()
left = deque([0])
right = deque([0])
cnt = 0
for s in S:
    if s == '<':
        cnt += 1
    else:
        cnt = 0
    left.append(cnt)
cnt = 0
for s in S[::-1]:
    if s == '>':
        cnt += 1
    else:
        cnt = 0
    right.appendleft(cnt)
ans = 0
for l, r in zip(left, right):
    ans += max(l, r)
print(ans)
# Judge status: Accepted
import sys
a=int(input())
if a%2==1:
  print(0)
  sys.exit()
i=10
ans=0
while i<=a:
  ans+=a//i
  i*=5
print(ans)
# Judge status: Wrong Answer
N=int(input())
L1=sorted(list(map(int,input().split())))
ans=L1[0]
L1.pop(0)
for i in range(len(L1)):
    ans=(ans+L1[i])/2
    print(ans)
print(ans)
# Judge status: Accepted
N, M, X, Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

if max(x) < min(y) and  X < max(x) <= Y and X < min(y) <= Y:
    print("No War")
else:
    print("War")
# Judge status: Accepted
A, B, C = map(int, input().strip().split())
K = int(input())

while A >= B and K > 0:
    B = B * 2
    K -= 1

while B>=C and K>0:
    C=C*2
    K-=1

if A<B and B<C :
    print("Yes")
else:
    print("No")
# Judge status: Accepted
n,m=map(int,input().split())
h=list(map(int,input().split()))
ac=[1]*n
for i in range(m):
  a,b=map(int,input().split())
  if h[a-1]>h[b-1] and ac[a-1] != 0:
    ac[a-1]=1
    ac[b-1]=0
  elif h[a-1]<h[b-1] and ac[b-1] != 0:
    ac[a-1]=0
    ac[b-1]=1
  else:
    ac[b-1]=0
    ac[a-1]=0

print(ac.count(1))
# Judge status: Accepted
N = int(input())
A = reversed(tuple(enumerate(map(int, input().split()), 1)))

boxes = [0] * (N + 1)
ans = []

for n, digit in A:
    put = sum(d for d in boxes[n::n]) & 1 != digit
    if put:
        boxes[n] = 1
        ans.append(n)

print(len(ans))
if ans:
    print(*ans)
# Judge status: Accepted
a,b=map(int,input().split())
s=list(input())
s[b-1]=s[b-1].lower()
print("".join(s))
# Judge status: Wrong Answer
n,m=map(int, input().split())
l=range(1,m+1)
for i in range(n):
  b=list(map(int, input().split()))
  b.pop(b[0])
  l=set(l)&set(b)

print(len(l))
# Judge status: Accepted
n,m = map(int,input().split())
L = [0]*n
penalty = [0]*n
ans = 0
out = 0
for i in range(m):
  p,q = input().split()
  if q == 'AC':
    if L[int(p)-1] == 0:
      L[int(p)-1] = 1
      ans += 1
  else:
    if L[int(p)-1] == 0:
      penalty[int(p)-1] += 1
for i in range(n):
  if L[i] == 1:
    out += penalty[i]
print(ans,out)
# Judge status: Wrong Answer
r = int()

result = r*r
print (result)
# Judge status: Accepted
n,m=map(int,input().split())
dp=[1]
for i in range(1,10**5+1):
  dp.append(dp[-1]*i%(10**9+7))
if n==m:
  print((2*(dp[n]**2))%(10**9+7))
elif n+1==m:
  print(dp[n]*dp[m]%(10**9+7))
elif m+1==n:
  print(dp[m]*dp[n]%(10**9+7))
else:
  print(0)
# Judge status: Accepted
N = int(input())

ans = 0

for i in range(1, N+1):
    ans += i
    if ans >= N:
        break

for j in range(1, i+1):
    if ans - N == j:
        continue
    print(j)
# Judge status: Accepted
A, B, K = map(int, input().split())
now = 0
for i in range(100):
    tmp = 100-i
    if A % tmp == 0 and B % tmp == 0:
        now += 1
        if now == K:
            print(tmp)
# Judge status: Accepted
s =list(input())


m = min(s.count('0'),s.count('1'))

print(2*m)
# Judge status: Accepted
A, V = map(int, input().split())
B, W = map(int, input().split())
T = int(input())

if V <= W:
    print("NO")
    exit()

dist = abs(A - B)
if V*T - W*T < dist:
    print("NO")
else:
    print("YES")
# Judge status: Accepted
n=int(input())
a=list(map(int,input().split()))
L=[0]*n

ans=[]
for i in range(n-1,-1,-1):
    if i+1>n//2:
        L[i]=a[i]
    else:
        t=n//(i+1)
        el=0
        for j in range(2,t+1):
            el += L[(i+1)*j-1]
        L[i]=(el+a[i])%2
    if L[i]==1:
        ans.append(str(i+1))

print(len(ans))
if len(ans)>0:
    print(' '.join(ans))
# Judge status: Accepted
li = list(input())

cnt = 0 
101
if (li[0] == "1"):
    cnt += 1
if (li[1] == "1"):
    cnt += 1
if (li[2] == "1"):
    cnt += 1

print(cnt)
# 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: Wrong Answer
S = input()
K = int(input())
count = 0
for i in range(len(S)):
    if S[i] == "1":
        count += 1
if count == len(S):
    print("1")
    exit()

for i in range(len(S)):
    if S[i] != "1":
        ans = S[i]
        break
        
print(ans)
# Judge status: Accepted
n = int(input())
num = list(map(int,input().split()))
ans = 0
m = num[0]

for i in range(1,n):
  if m >= num[i]:
    ans += m - num[i]
  else:
    m = num[i]
print(ans)
# Judge status: Accepted
# -*- coding: utf-8 -*-
n = input()
if sum(list(map(int, list(n)))) % 9 == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
n,k = map(int,input().split())
A = list(map(int,input().split()))
ans = 0
for i in range(1, n):
    if A[i]+A[i-1]<=k:
        continue
    ans += (A[i]+A[i-1])-k
    A[i] = k-A[i-1]
print(ans)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(['No','Yes'][a+b == c or a+c == b or b+c == a])
# Judge status: Accepted
# 2020/05/22
# AtCoder Beginner Contest 072 - D

# Input
n = int(input())
p = list(map(int,input().split()))

i = 0
cnt = 0
while i < n:
    if p[i] == i+1:
        cnt = cnt + 1
        i = i + 2
    else:
        i = i + 1

# Output
print(cnt)
# Judge status: Wrong Answer
n=int(input())
AB=[list(map(int,input().split())) for _ in range(n)]

if n % 2 == 1:
  mid=(n+1)//2
  print(AB[mid-1][1]-AB[mid-1][0]+1)
else:
  mid=n//2
  print(AB[mid][1]+AB[mid-1][1]-AB[mid][0]-AB[mid-1][0]+1)
# Judge status: Accepted
a, b, c = map(int, input().split())

print(len(list(set([a, b, c]))))
# Judge status: Accepted
n = int(input())
A = [int(x) for x in input().split()]
sumA = sum(A)
res = sumA
cc = 0
for a in A:
  cc += a
  res = min(res, abs(sumA - 2 * cc))
print(res)
# Judge status: Wrong Answer
n,x = map(int,input().split())
a = [int(i) for i in input().split()]
ans = 0
for i in range(n-1):
    if a[i] + a[i+1] <= x: continue
    a[i+1] = max(0,a[i+1]-x)
    ans += a[i] + a[i+1] - x
print(ans)
# Judge status: Wrong Answer


def main():
    n = int(input())
    lst = []
    for _ in range(5):
        lst.append(int(input()))
    m = n
    ans = 5
    for i in range(4):
        if m // lst[i] > 0:
            ans += m // lst[i]
            m = lst[i]
    print(ans)


if __name__ == "__main__":
    main()
# Judge status: Accepted
N, M = map(int, input().split())
if N == M:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
#!/usr/bin/env python3

#alphabet=[chr(ord('a') + i) for i in range(26)]

InputChar=input()
print(chr(ord(InputChar)+1))
# Judge status: Wrong Answer
def myAnswer(S:str) -> str:
   for i in range(len(S)-1):
      for j in range(i+1,len(S)):
         if(S[:i]+S[j:] == "keyence"):
            return "YES"
   return "NO"

def modelAnswer():
   return
def main():
   S = (input())
   print(myAnswer(S))
if __name__ == '__main__':
   main()
# Judge status: Wrong Answer
n,k=map(int, input().split())
a=[int(i) for i in input().split()]
if n==k:
    print(1)
else:
    k-=1
    print((n+k-1)//k)
# Judge status: Accepted
import itertools
n,m,q = list(map(int,input().split()))
a = [0]*q
b = [0]*q
c = [0]*q
d = [0]*q
for i in range(q):
    a[i],b[i],c[i],d[i] = list(map(int,input().split()))
    b[i]-=1
    a[i]-=1
ans=0

for seq in itertools.combinations_with_replacement(range(m),n):
    tmp = 0
    #print(seq)
    for i in range(q):
        if seq[b[i]]-seq[a[i]]==c[i]:
            tmp+=d[i]
    ans = max(ans,tmp)
print(ans)
# Judge status: Accepted
def main():
    a, b, c = map(int, input().split())
    cond = b * 2 == a + c
    print('YES' if cond else 'NO')


if __name__ == '__main__':
    main()
# Judge status: Accepted
def check(num,memo={}):
  if num==0:
    return 2
  elif num == 1:
    return 1
  elif num in memo:
    return memo[num]
  else:
    memo[num] = check(num-1,memo) + check(num-2,memo)
    return memo[num]

print(check(int(input())))
# Judge status: Accepted
a = int(input())
print(a + a ** 2 + a ** 3)
# Judge status: Accepted
import bisect

N = int(input())

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

A.sort()

ans = 0
for a in range(N-2):
    for b in range(a+1, N-1):
        ans += bisect.bisect_left(A, A[a]+A[b])-b-1

print(ans)
# Judge status: Accepted
s = int(input())

a = [s]
ai = s
for i in range(2, 10**6 + 2):
    if ai % 2 == 0:
        ai = ai/2
        if ai in a:
            print(i)
            break
    else:
        ai = 3*ai + 1
        if ai in a:
            print(i)
            break
    a.append(ai)
# Judge status: Accepted
a,b,c = map(int,input().split())
print(int((a*b)/2))
# Judge status: Accepted

a,b,k = map(int,input().split())
ans = []

for i in range(k):
    if a + i > b:
        break
    ans.append(a+i)

#print(ans)
for j in range(k):
    if b-j<a:
        break
    ans.append(b-j)
v = set(ans)
w = list(v)
w.sort()
#print(w)

for l in w:
    print(l)
# Judge status: Wrong Answer
N,X,Y = map(int,input().split())

ans = [0]*N

for i in range(1,N):
    for j in range(i+1,N+1):
        if i <= X and Y <= j:
            road = min(j-i,(X-i)+(j-Y)+1)
            ans[road] += 1
        else:
            road = j-i
            ans[road] += 1

for i in range(1,N):
    print(ans[i])
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline

def inp():
    return int(input())
def inpl():
    return list(map(int, input().split()))
def _debug(obj):
    print(obj, file=sys.stderr)

# ---------------------------------------

s = input()
if s[-1] == "s":
    s += "es"
else:
    s += "s"
print(s)
# Judge status: Accepted
from math import sqrt
N = int(input())
print(int(sqrt(N)) ** 2)
# Judge status: Accepted
from collections import deque
n,m = list(map(int,input().split()))
graph = [[] for _ in range(n+1)]
for i in range(m):
    a, b = list(map(int,input().split()))
    graph[a].append(b)
    graph[b].append(a)
# print(graph)
arrow = [-1]*(n+1)
d = deque()
d.append(1)

while d:
    v = d.popleft()
    for i in graph[v]:
        if arrow[i]!=-1:
            continue
        arrow[i] = v
        d.append(i)
    # print(dist)

print('Yes')
print(*arrow[2:], sep='\n')
# Judge status: Wrong Answer

def main():
  num = int(input())
  print(num*num)
# Judge status: Wrong Answer
d,t,s=map(int,input().split())
c=d//s
cc= round(c,2)
if cc<=t:
    # print(c)
    print("Yes")
else:
    print("No")
# Judge status: Accepted
N,Q = map(int,input().split())
S = list(input())

a = [0 for i in range(N)]
b = [0 for i in range(N)]

for i in range(N-1):
  if S[i] == "A" and S[i+1] == "C":
    a[i] = 1
    b[i+1] = 1
    
def cumsum(xs):
  result = [xs[0]]
  for x in xs[1:]:
    result.append(result[-1] + x)
  result.append(0)
  result.sort()
  return result

A = cumsum(a)
B = cumsum(b)

for i in range(Q):
  l,r = map(int,input().split())
  print(int(B[r] - A[l-1]))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
if a > b:
    print(min(c - (a - b), 0))
else:
    print(c)
# Judge status: Accepted
N=int(input())
a=N%2
if a == 0:
  print(int(N/2))
else:
  print(int((N+1)/2))
# Judge status: Wrong Answer
x,y=map(int,input().split())
print(x+y/2)
# Judge status: Wrong Answer
a, b = input().split()
a = int(a)
b = float(b)
b_int = int(b)
b_float = b - b_int
print(a * b_int + int(a * b_float))
# Judge status: Accepted
a, b, c = map(int, input().split())
if a <= c <= b:
    print("Yes")
else:
    print("No")
# Judge status: Accepted
test = int(input())

ac = 0
wa = 0
tle = 0
re = 0


for i in range(test):
    n = input()

    if n == "AC":
        ac += 1

    if n == "WA":
        wa += 1

    if n == "TLE":
        tle += 1

    if n == "RE":
        re += 1




print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")
# Judge status: Accepted
N = input()

if N[2] == N[3]:
    if N[4] == N[5]:
        print("Yes")
    else:
        print("No")
else:
    print("No")
# 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
nums = sorted(map(int, input().split()))
print(nums[0] + nums[1] + nums[2]*10)
# Judge status: Accepted
n, *p = map(int, open(0).read().split())
c = 0
for i in range(2, n):
    t = p[i-2:i+1]
    c += sorted(t)[1] == t[1]
print(c)
# Judge status: Wrong Answer
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
l=list(mi())
l=list(map(lambda x: x*-1 , l))
heapq.heapify(l)
for i in range(b):
  s=heapq.heappop(l)
  s=(-1)*(-1*s)//2
  heapq.heappush(l,s)
ans=0
for i in range(a):
  d=heapq.heappop(l)
  ans+=(-1)*d
print(ans)