peterverebics/CodeNet_Python_428 huggingface dataset:
# Judge status: Accepted
import sys
import collections
import heapq
import math
n,m = map(int,sys.stdin.readline().split())
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(max(n - r,0)) * math.factorial(r))
print(combinations_count(n,2)+combinations_count(m,2))
# Judge status: Accepted
s = input()
print(s[0]+s[8]+s[-7])
# Judge status: Wrong Answer
a=int(input())
b=[int(input()) for i in range(a)]
b.sort()
ans=0

for i in range(a):
	if b[i]%10!=0 and sum(b)%10==0:
		ans=sum(b)-b[i]
		break
print(ans)
# Judge status: Accepted
s=input()
l=[]
for i in s:
    if(i=='1'):
        l.append('1')
    elif(i=='0'):
        l.append('0')
    else:
        if(l!=[]):
            l.pop()
print(''.join(l))
# Judge status: Accepted
import math

N = int(input())
xy = [list(map(int,input().split())) for i in range(N)]
ave = 0
cnt = 0
import itertools
for v in itertools.permutations([int(x) for x in range(N)],N) :
    for i in range(1,len(v)) :
        ave += math.sqrt((xy[v[i-1]][0]-xy[v[i]][0])**2+(xy[v[i-1]][1]-xy[v[i]][1])**2)
    cnt += 1

ave = ave / cnt
print(ave)
# Judge status: Wrong Answer
import math
from sys import stdin

n, k = map(int, stdin.readline().rstrip().split())
ans = 0
for i in range(1, n + 1):
    if k / i <= 1:
        ans += (1 / n)
    else:
        ans += (1 / n) / 2 ** (int(math.log2(k / i)) + 1)
print(ans)
# Judge status: Wrong Answer
print(' YNeos'[len(set([2 if i==2 else 1 if i==[4,6,9,11] else 0 for i in list(map(int,input().split()))]))::2])
# Judge status: Accepted
"""
aabbaa

aa b ba a
a ab b aa
"""
s = list(input())

n = len(s)
hst = []
sk = ""

for i in range(n):
    sk += s[i]
    if i == 0:
        hst.append(sk)
        sk = ""
    elif hst[-1] != sk:
        hst.append(sk)
        sk = ""

print(len(hst))
# Judge status: Wrong Answer
c = [list(map(int,input().split())) for _ in range(3)]
a1 = sum(c[0])
a2 = sum(c[1])
a3 = sum(c[2])
ans = "No"
for i in range(101):
    if (a1-i)%3 == 0 and (a2-i)%3 == 0 and (a3-i)%3 == 0:
        ans = "Yes"
        break
print(ans)
# Judge status: Accepted
def main():
    a, b = map(int, input().split())
    print((a + b) % 24)


if __name__ == '__main__':
    main()
# Judge status: Accepted
lis = []

for _ in range(5):
    lis.append(int(input()))
    
k = int(input())

for i in range(5):
    for j in range(i+1, 5):
        if (lis[j] - lis[i]) > k:
            print(":(")
            exit()

print("Yay!")
# Judge status: Accepted
import math

S = int(input())
t = math.sqrt(S)
a = b = math.ceil(t)

if a*(b-1) >= S:
  b -= 1

d = a*b - S
if d == 0:
  c = 0
else:
  c = 1
print("0 0 {} {} {} {}".format(a, c, d, b))
# Judge status: Accepted
n=int(input())
for i in range(10):
    for s in range (10):
        result=i*s
        if n==result:
            print('Yes')
            exit()
        elif result<81:
            continue
        else:
            print('No')
# Judge status: Wrong Answer
import math
from itertools import combinations 
n,k=map(int,input().split())
ｌ=list(map(int,input().split()))
min1=min(list(combinations(l,k)))
sum1=int(math.fsum(min1))
print(sum1)
# Judge status: Accepted

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

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

#n = 2 * 10 ** 5
#a = [0] * n
cnt = 0

while cnt < k:
    imos = [0] * (n + 1)
    for i in range(n):
        imos[max(i - a[i], 0)] += 1
        imos[min(i + a[i] + 1, n)] -= 1
    for i in range(n):
        imos[i + 1] += imos[i]
    a = imos[0:n]
    cnt += 1
    if min(a) == n:
        break
print(*a)
# Judge status: Wrong Answer
n=int(input())
m=[]
M=[]
for _ in range(n):
    x,y=map(int,input().split())
    m.append(x)
    M.append(y)
m=sorted(m)
M=sorted(M)

z=n//2
if n%2==1:
    a=m[z]
    b=M[z]
    print(b-a+1)
else:
    a=(m[z]+m[z-1])//2
    b=(M[z]+M[z-1])//2
    print(2*(b-a)+1)
# Judge status: Accepted
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import defaultdict


N = int(read())
counter = defaultdict(int)
for x in map(str,range(1,N+1)):
    head = x[0]
    tail = x[-1]
    counter[(head, tail)] += 1
ans = 0
items = list(counter.items())
for (head, tail), cnt in items:
    ans += cnt * counter[(tail, head)]
print(ans)
# Judge status: Accepted
l = sorted(list(map(int,input().split())))
print(10*l[2]+l[1]+l[0])
# Judge status: Wrong Answer
S=input()
count=0
for i in range(len(S)):
  if S[i]!=S[-i-1]:
    count+=1
print(count)
# Judge status: Wrong Answer
if __name__ == "__main__":
  a, b, c = map(int,input().split())
  ans = 3
  if a == b:
    ans -= 1
  if b == c:
    ans -= 1
  if c == a:
    ans -= 1
  print(ans)
# Judge status: Accepted
import numpy as np
n,k = list(map(int,input().split()))
h=np.array([int(i) for i in input().split()])
dp = np.array([0]*n)
for i in range(1,n):
    j=max(0,i-k)
    dp[i] = np.min(dp[j:i]+abs(h[i]-h[j:i]))
print(dp[-1])
# Judge status: Wrong Answer
s = input()
print('×' * len(s))
# Judge status: Accepted
# -*- coding: utf-8 -*-

N = int(input())

print((N + 1) // 2)
# Judge status: Accepted
import math

N = int(input())

if N % 2 == 0:
    ans = 0
    for i in range(0, 26):
        ans += N // (5 ** i * 10)

    print(ans)
else:
    print(0)
# Judge status: Accepted
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
d=[]
a=(int(input()))*-1
d.append(a)
ans=1
for i in range(n-1):
    a=-1*(int(input()))
    ind=bisect.bisect_right(d,a)
    l=len(d)
    if ind==l:
        d.append(a)
        ans+=1
    else:
        d[ind]=a
print(ans)
# Judge status: Wrong Answer
a = [1,3,5,7,8,10,12]
b = [4,6,9,11]
x,y = map(int, input().split())
if (x in a and b in a) or (x in b and y in b):
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
x = list(input())

if x[0] == x[1] and x[1]==x[2]:
  print("Yes")
else:
  print("No")
# Judge status: Wrong Answer
N, M = map(int,input().split())

total = N * M

sumi = 4
if N >= 2 and M >= 2:
    hen = (N-2) * 2 + (M-2) * 2
    ans = total - sumi - hen
elif N == 1 and M > 1:
    hen = M-2
    ans = hen
elif N > 1 and M == 1:
    hen = N - 2
    ans = hen
else:
    ans = 0


print(ans)
# Judge status: Wrong Answer
n=int(input())
s=list(map(int,input().split()))
q=list(map(int,input().split()))

li=[]

for i in range(1,n+1):
  for j in range(1,n+1):
    for k in range(1,n+1):
      if i==k or i==j or j==k:
        continue
      else:
        li.append([i,j,k])
result1=0
result2=0
for i in range(len(li)):
  if li[i]==s:
    result1=i+1
  if li[i]==q:
    result2=i+1
print(abs(result1-result2))
# Judge status: Wrong Answer
import sys
input = sys.stdin.readline
N = int(input())
S = list(input().rstrip())
maxx = -(10 ** 9)
x = 0
for i in S:
    if i == "I":
        x += 1
    else:
        x -= 1
    if x > maxx:
        maxx = x
print(x)
# Judge status: Wrong Answer
n,m = map(int,input().split())
count_ac = 0
count_wa = 0
l = [('','')]*m
memo_n = []
idx = 0
for i in range(m):
    t = tuple(input().split())
    l[i] = t
    if t[1] == 'AC' and t[0] not in memo_n:
        memo_n.append(t[0])
        count_ac += 1
        count_wa += l[idx:i+1].count((t[0],'WA'))
        idx = i

print(str(count_ac) + " " + str(count_wa))
# Judge status: Accepted
S = input()
if ("9" in S) == True:
    result = "Yes"
else:
    result = "No"
print(result)
# Judge status: Wrong Answer
n = int(input())
a = 0
b = 0
c = 0

for i in range(1, n+1):
	j = i
	while j%2 == 0:
		a += 1
		j = j/2
	if a > b:
		b = a
		c = i
	a = 0
print(c)
# Judge status: Accepted
n,q=(map(int,input().split()))
s=input()
count=0
c=[0]*n
for i in range(1,n):
        if s[i-1]=='A':
            if s[i]=='C':
               count+=1
        c[i]=count
for _ in range(q):
    l,r=(map(int,input().split())) 
    print(c[r-1]-c[l-1])
# Judge status: Accepted
S = str(input())
T = str(input())
count = 0

for i in range(len(S)):
  if S[i] != T[i]:
    count = count + 1
    
print(count)
# Judge status: Wrong Answer
X = list(input())
N = len(X)
NHALF = N // 2

def solve2():
    leadt = 0
    nt, ns = 0, 0
    for i in range(N):
        if nt == NHALF:
            break
        if X[i] == 'T':
            nt += 1
            if ns == 0:
                leadt += 1
        else:
            ns += 1
    return N - 2 * min(ns, NHALF - leadt)


print(solve2())
# Judge status: Accepted
s = list(input())
ans = 'Yes'
for i in range(len(s)):
    if i%2!=0 and not(s[i]=='L' or s[i]=='U'or s[i]=='D'):
        ans = 'No'
    elif i%2==0 and not(s[i]=='R' or s[i]=='U'or s[i]=='D'):
        ans = 'No'

print(ans)
# Judge status: Accepted
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

k = v-w
m = abs(a-b)
if k*t >= m:
    print("YES")
else:
    print("NO")
# Judge status: Accepted
n=int(input())
l=list(map(int,input().split()))
allsum=sum(l)
mx = max(l)
if mx < allsum-mx:
  print('Yes')
else:
  print('No')
# Judge status: Accepted
N,C,K = list(map(int,input().split()))
T = [0]*N
for i in range(N):
  T[i] = int(input())
T.sort()
i = 0
ret = 0
while i < N:
  j = i
  ret += 1
  while j < N and j < i+C and T[j] <= T[i]+K:
    j += 1
  i = j
print(ret)
# Judge status: Accepted
S = input()
Sl = list(S)

if Sl[0] == Sl[1]:
  print('Bad')
elif Sl[1] == Sl[2]:
  print('Bad')
elif Sl[2] == Sl[3]:
  print('Bad')
else:
  print('Good')
# Judge status: Accepted
A,B,C = map(int,input().split())
print(max(10*A+B+C,10*B+C+A,10*C+A+B))
# Judge status: Wrong Answer
x = input()

print("2018" + x[6:])
# Judge status: Accepted
n,m=map(int,input().split())
b=m//2
a=m-b

for i in range(a):
    print(1+i,2*a-i)
for i in range(b):
    print(2*a+1+i,2*a+2*b+1-i)
# Judge status: Accepted
c1=list(input())
c2=list(input())
if c1[0]==c2[2] and c1[1]==c2[1] and c1[2]==c2[0]:
    print('YES')
else:
    print('NO')
# Judge status: Accepted
import sys
li = list(input())
new_li = []
if len(li) == 1:
    print(1)
    sys.exit()
tmp = ''
for i,l in enumerate(li):
    if i == 0:
        new_li.append(li[0])
        continue
    if len(tmp)>0:
        new_li.append(tmp+l)
        tmp = ''
    elif new_li[-1] != l:
        new_li.append(l)
    else:
        tmp = l
print(len(new_li))
# Judge status: Wrong Answer
a, b, c = map(int, input().split())
ans = 'Yes' if (a + b - c + 2*(a*b)**0.5) < 0 else 'No'
print(ans)
# Judge status: Accepted
N, Q = map(int, input().split())
S = input()
s = S[:2]
ans = 'AC'
lst = [0]
count = 0
for i in range(N-1):
    s = S[i] + S[i + 1]
    count += (s == ans)
    lst.append(count)

for _ in range(Q):
    a, b = map(int, input().split())
    print(lst[b - 1] - lst[a - 1])
# Judge status: Wrong Answer
N = int(input())
a = []
flag = 0

for i in range(N):
    t = input()
    if t not in a:
        a.append(t)
    else:
        flag = 1

if flag == 0:
    print('Yes')
else:
    print('No')
# Judge status: Wrong Answer
a, b = map(int, input().split())

if a%2 == 0 and b%2 == 0:
    print('Even')
else:
    print('Odd')
# Judge status: Accepted
n,m,X,Y = map(int,input().split())
x = max(list(map(int,input().split())))
y = min(list(map(int,input().split())))
if y-x > 0 and x < Y and y > X:
    print('No War')
else:
    print('War')
# Judge status: Accepted
N = int(input())
A = list(map(int, input().split()))
Q = int(input())

from collections import defaultdict
d = defaultdict(int)
S = 0
for a in A:
   d[a] += 1
   S += a

for _ in range(Q):
   b, c = map(int, input().split())
   S += d[b] * (c - b)
   print(S)
   d[c] += d[b]
   d[b] = 0
# Judge status: Wrong Answer
n = int(input())
wr = input()

j = n
ans = 0
for i in range(0,n):
  if wr[i] == 'W':
    while j>=1:
      j-=1
      if wr[j] == 'R':
        ans+=1
        break
print(ans)
# Judge status: Accepted
S = input()

if S[0] == "A" and "C" in S[2:-1] and S.count("C") == 1 and len([s for s in S if s.isupper()]) == 2:
    print("AC")
else:
    print("WA")
# Judge status: Accepted
a,b,c,d = map(int,input().split())
count = 0
for i in range(101):
  if a<=i<b and c<=i<d:count+=1
print(count)
# Judge status: Accepted
#9 B - Choose Integers AC(hint)
A,B,C = map(int,input().split())

result = 'NO'

num = 0
#(k+B)A%B = (kA + AB)%B = kB
for i in range(1,B+1):
    num = (A*i)%B
    if num == C:
        result = 'YES'
        break
print(result)
# Judge status: Accepted
N,M = map(int,input().split())
correct = [0]*N
penalty = [0]*N
ans_c,ans_p = 0,0
for i in range(M):
    p,s = input().split()
    p = int(p)
    if s=="AC":
        if correct[p-1]==0:
            correct[p-1]+=1
    if s=="WA":
        if correct[p-1]==0:
            penalty[p-1]+=1

ans_penalty = 0
for i in range(N):
    if correct[i]>=1:
        ans_penalty+=penalty[i]
print(sum(correct),ans_penalty)
# Judge status: Wrong Answer
N = int(input())

print(10**N-2*9**N+8**N)
# Judge status: Accepted
x, y = map(int, input().split())
aa =  y - 2 * x
a = aa / 2
print('Yes' if 0 <= a <= x and aa % 2 ==0 else 'No')
# Judge status: Wrong Answer
A,B,C=map(int,input().split())
if B<C:
    print(0)
elif A*C>B:
    print(A)
else:
    print(C)
# Judge status: Accepted
s=int(input())
x1,y1=0,0
x2,y2=10**9,1
x3,y3=0,0

mod=10**9
r=(mod-s%mod)%mod
q=(s+r)/mod
x3=int(r)
y3=int(q)
print(x1,y1,x2,y2,x3,y3)
# Judge status: Accepted
from itertools import product
A,B,C,D = list(input().strip())
for x in product(("+","-"),repeat=3):
    if eval(A+x[0]+B+x[1]+C+x[2]+D)==7:
        print(A+x[0]+B+x[1]+C+x[2]+D+"=7")
        break
# Judge status: Accepted
import heapq
N,M=map(int,input().split())
W=[list(map(int,input().split())) for _ in range(N)]
a=[[i,0] for i in range(1,M+2)]
W.extend(a)
W.sort()
q=[]
ans=0
for i,j in W:
    if i>M+1:
        break
    if j!=0:
        heapq.heappush(q,-j)
    else:
        heapq.heappush(q,-j)
        ans-=heapq.heappop(q)
print(ans)
# Judge status: Wrong Answer
n,d = [int(i) for i in input().split()]
a = 2*d+1
print((n+d-1)//d)
# Judge status: Wrong Answer
def cal():
    x = input()
    i = 0
    while i <= 2*10**5:
        i += 1
        x1 = x.replace('ST', '', 10**5)
    print(len(x))

cal()
# Judge status: Accepted
#!/usr/bin/env python3

N, K = list(map(int, input().split()))
p_list = list(map(int, input().split()))

ans = sum(sorted(p_list)[:K])

print(ans)
# Judge status: Accepted
a, b = input().split()
aa, bb= "", ""
for i in range(int(b)):
    aa += a
for i in range(int(a)):
    bb += b
if int(aa) >= int(bb):
    print(aa)
else:
    print(bb)
# Judge status: Wrong Answer
s = list(input())
i = len(s)
p = 0
while i >= 3:
    if s[i-1] == s[i-2]:
        i -= 3
        p += 2
    else:
        i -= 1
        p += 1

print(p + 1)
# Judge status: Accepted
a,b,c = map(int,input().split())
print("Yes" if a+b >= c else "No")
# Judge status: Accepted
N, M = map(int, input().split())
a = [0] * (N+1)
for _ in range(M):
    i = int(input())
    a[i] = 1

dp = [0] * (N+2)
dp[N] = 1
mod = 1000000007

for i in range(N-1, -1, -1):
    if a[i]:
        dp[i] = 0
        continue
    dp[i] = (dp[i+1] + dp[i+2]) % mod 

print(dp[0])
# Judge status: Wrong Answer
k=int(input())
if k%2==0:
    print((k/2)**2)
else:
    print((k//2)*(k//2+1))
# Judge status: Accepted
a = input()
l = a.split()
n = int(l[0])
m = int(l[1])
if n == m:
    print("Yes")
else:
    print("No")
# Judge status: Wrong Answer
def LI(): return list(map(int,input().split()))
N,x = LI()
a = LI()
ans = 0
sum_a = []
for i in range(N-1):
    sum_a.append(a[i]+a[i+1])
sum_a = [0]+sum_a+[0]
for j in range(N):
    if sum_a[j]>x:
        ans += sum_a[j]-x
        sum_a[j+1] -= sum_a[j]-x
print(ans)
# Judge status: Accepted
import sys
import math

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def main():
    N = ii()
    A = list(mi())
    for i in range(N):
        A[i] -= i+1
    median = sorted(A)[N//2]
    print(sum(abs(A[i]-median) for i in range(N)))


if __name__ == '__main__':
    main()
# Judge status: Wrong Answer
N, T = map(int, input().split())
min_c = 1001
for _ in range(N):
    c, t = map(int, input().split())
    if t <= T and c < min_c:
        min_c = c
print('TLE' if min_c == 1000 else min_c)
# Judge status: Accepted
L = [10, 50, 250, 1250, 6250, 31250, 156250, 781250, 3906250, 19531250, 97656250, \
     488281250, 2441406250, 12207031250, 61035156250, 305175781250, 1525878906250, \
     7629394531250, 38146972656250, 190734863281250, 953674316406250, \
     4768371582031250, 23841857910156250, 119209289550781250, 596046447753906250]
N = int(input())
A = 0
if N % 2 == 0:
  for i in L:
    A += N // i
print(A)
# 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 i in range(m):
    b.append(b[i]+B[i])
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
it = lambda: list(map(int, input().strip().split()))

def solve():
    X, K, D = it()
    X = abs(X)
    if X - K * D >= 0:
        return X - K * D
    K = K - X // D
    X = X - X // D * D
    assert K >= 0
    assert X >= 0
    return abs(X) if K % 2 == 0 else abs(X - D)


if __name__ == '__main__':
    ans = solve()
    print(ans)
# Judge status: Wrong Answer
x, y, z = input().split()
a, b, c = input().split()
d, e, f = input().split()
N = int(input())
for i in range(1, N+1):
    i = input()
    if i == x or i == y or i == z or i == a or i == b or i ==c or i == d or i == e or i == f:
        print('Yes')
    else:
        print('No')
# Judge status: Accepted
S = list(input())
cnt = S.count('1')
print(cnt)
# Judge status: Accepted
a, b, c = map(str, input().split())
A = [i for i in a]
B = [i for i in b]
C = [i for i in c]
print(A[0]+B[0]+C[0])
# Judge status: Accepted
N=int(input())
A=list(map(int,input().split()))
B=[0]*N
for i in range(N-1):
  B[A[i]-1]+=1
for i in range(N):
  print(B[i])
# Judge status: Wrong Answer
N = int(input())
S = [int(input()) for _ in range(N)]
S.sort()
res = sum(S)
i = 0
while res > 0 and res % 10 == 0:
    res -= S[i]
    i -= 1
print(res)
# Judge status: Wrong Answer
from heapq import heappop,heappush
x,y,a,b,c=map(int,input().split())
p=list(map(int,input().split()))
p.sort(reverse=1)
q=list(map(int,input().split()))
q.sort(reverse=1)
r=list(map(int,input().split()))+[0]
r.sort(reverse=1)
h=[]
m=p[0]
for i in range(x):
  heappush(h,p[i])
  m=min(m,p[i])
for i in range(y):
  heappush(h,q[i])
  m=min(m,q[i])
i=0
while m<r[i]:
  m=heappop(h)
  heappush(h,r[i])
  i+=1
print(sum(h))
# Judge status: Accepted
import fractions
a,b=map(int,input().split())
g=fractions.gcd(a,b)
ans=1
i=2
while i*i<=g:
    if g%i==0:
        ans+=1
        while g%i==0:
            g//=i
    i+=1
if g>1:
    ans+=1
print(ans)
# Judge status: Accepted
n, m = map(int, input().split())
LR = [list(map(int, input().split())) for _ in range(m)]

L_max = 0
R_min = 10 ** 5 + 1
for L, R in LR:
    L_max = max(L_max, L)
    R_min = min(R_min, R)

ans = R_min - L_max + 1
if ans < 0:
    print(0)
else:
    print(ans)
# Judge status: Accepted
s = [ list(input()) for i in range(2)]
t = [ [0 for j in range(3)] for i in range(2) ]
for i in range(2):
    for j in range(3):
        t[1-i][2-j] = s[i][j]
print("YES" if s == t else "NO")
# Judge status: Accepted
n , a, b = map(int, input().split())

if b < a:
    print(0)
    exit()

if n == 1:
    if a != b:
        print(0)
        exit()
    else:
        print(1)
        exit()

print((n-2) * (b-a) + 1)
# Judge status: Wrong Answer
N = int(input())
t = [0]*100001
x = [0]*100001
y = [0]*100001
for n in range(N):
    t[n+1], x[n+1], y[n+1] = map(int, input().split())
ans = True
for n in range(N):
    dt   = t[n+1] - t[n]
    dist = (x[n+1] - x[n]) + (y[n+1] - y[n])
    if dt < dist:
        ans = False
    if dt % 2 != dist % 2:
        ans = False
if ans:
    print('Yes')
else:
    print('No')
# Judge status: Accepted
a,b = map(int,input().split())
print(a*b if max(a,b) < 10 else -1)
# Judge status: Wrong Answer
import itertools
import math
import collections

def func(x,y,z):
    return x**2+y**2+z**2+x*y+y*z+z*x
 
n = int(input())
s = int(math.sqrt(n))
nums = list(range(1,s))
arr = []
com = list(itertools.product(nums, repeat=3))
for i in range(len(com)):
    # print(com)
    ans = func(com[i][0],com[i][1],com[i][2])
    arr.append(ans)
 

c = collections.Counter(arr)
for i in range(n):
    print(c[i])
# Judge status: Accepted
A=list(map(int,input().split()))
N=A[0]
K=A[1]
p=0
for i in range(1,N+1):
    count=0
    while i<=K-1:
        i=i*2
        count=count+1
    p=p+(1/2)**(count)
print(p/N)
# Judge status: Wrong Answer
o = input()
e = input()
lis = []
for i in range(max(len(o),len(e))-1):
    lis.append(o[i])
    lis.append(e[i])
if len(o)>len(e):
    lis.append(o[-1])
elif len(o)==len(e):
    lis.append(o)
    lis.append(e)

print(''.join(lis))
# Judge status: Accepted
N, M = map(int, input().split())
A = list(map(int, input().split()))

half = [i//2 for i in A]

def f(v):
    r = 0
    while v % 2 == 0:
        v /= 2
        r += 1
    return r

from fractions import gcd
def f2(x, y):
    return (x * y) // gcd(x, y)

d = f(A[0])
for ai in A:
    if d != f(ai):
        print(0)
        break
else:
    lcm = 1
    for ai in half:
        lcm = f2(lcm, ai)

    r = M // lcm
    ans = (r + 1) // 2
    print(ans)
# Judge status: Accepted
from collections import Counter
S=input()
T=input()
SS=Counter(S)
TT=Counter(T)
if sorted(SS.values())==sorted(TT.values()):
  print('Yes')
else:
  print('No')
# Judge status: Accepted
n, m = map(int, input().split())

if m%2 == 0:
    gu_max, ki_max = m, m-1
else:
    gu_max, ki_max = m-1, m
gu_start = 1
ki_start = 1 + gu_max + 1

for sa in range(m)[::-1]:
    sa += 1
    if sa%2 == 0:
        print(gu_start, gu_start+sa)
        gu_start += 1
    else:
        print(ki_start, ki_start+sa)
        ki_start += 1
# Judge status: Accepted
a,b = map(int, input().split())
if a + b >= 24:
  print(a + b - 24)
else:
  print(a + b)
# Judge status: Accepted
d, t, s = map(int, input().split())
if d/s <= t:
  print("Yes")
else:
  print("No")
# Judge status: Accepted
H, N = map(int, input().split())

dp = [[0] + [1e20] * (H) for _ in range(N)]

for i in range(N):
    A, B = map(int, (input().split()))
    for j in range(1, H + 1):
        dp[i][j] = min(dp[i - 1][j], dp[i][max(j - A, 0)] + B)

print(dp[-1][-1])
# Judge status: Accepted
N,K = map(int,input().split())
p = list(map(int,input().split()))

ans = 0
for i in range(K):
    ans += min(p)
    p.remove(min(p))

print(ans)
# Judge status: Accepted
S = input()
if S[0] != "A":
  print("WA")
  exit()
elif S[2:-1].count("C") != 1 or S[:2].count("C") != 0 or S[-1:].count("C") != 0:
  print("WA")
  exit()
else:
  S = S[1:].replace("C", "")
  if S.islower():
    print("AC")
  else:
    print("WA")
# Judge status: Wrong Answer
n=int(input())
ans = ""
for c in input():
  ans+= chr((ord(c)+n))
print(ans)
# Judge status: Accepted
import sys
n, m, k = map(int, input().split())

for i in range(n+1):
    for j in range(m+1):
        if i*(m-j)+(n-i)*j == k:
            print('Yes')
            sys.exit()
print('No')
# Judge status: Wrong Answer
list1 = input()
list1 = list1.split(' ')
list2 = input()
list2 = list2.split(' ')
list3 = input()
S = list1[0]
T = list1[1]
lenS = int(list2[0])
lenT = int(list2[1])
select = list3[0]
if select == S:
    lenS -= 1
else:
    lenT -= 1
print(lenS,lenT)
# Judge status: Wrong Answer
n, a, b, c, d = map(int, input().split())
s = input()
ss = s[min(a-1, b-1): max(c, d)]
if ss.count("##") or ((d < c or b < a) and ss.count("...") == 0):
    print("No")
else:
    print("Yes")
# Judge status: Accepted
n=int(input())
d=[]

for i in range(n):
    s,p=input().split()
    d.append((s,100-int(p),i+1))

d.sort()
for i in range(n):
    print(d[i][2])
# Judge status: Accepted
a,b,c=map(int,input().split())

if a+b+c>=22:
  print('bust')
else:
  print('win')