Harryxun/stf_run huggingface dataset:
n, a = map(int, input().split())
xlist = list(map(int, input().split()))

j = n
k = n
t = n * a
maxv = max(xlist)


dp = [[[0 for t in range(t + 1)] for k in range(k + 1)] for j in range(j + 1)]

dp[1][0][0] = 1
dp[0][0][0] = 1

# for d in dp:
#     print(d)
# print(dp[1][1][15])

for ji in range(0, j + 1):
    for ki in range(0, ji + 1):
        for ti in range(0, ki * maxv + 1):
            # print('now', ji, ki, ti)
            if ji == 0 and ki == 0 and ti == 0:
                # print('branch 1')
                dp[ji][ki][ti] = 1
            elif ji >= 1 and ti < xlist[ji - 1]:
                dp[ji][ki][ti] = dp[ji - 1][ki][ti]
                # print('branch 2')
            elif ji >= 1 and ki >= 1 and ti >= xlist[ji - 1]:
                # print('branch 3', ji - 1)
                dp[ji][ki][ti] = dp[ji - 1][ki][ti] + dp[ji - 1][ki - 1][ti - xlist[ji - 1]]
            # print(dp[ji][ki][ti])

count = 0
for i in range(1, k + 1):
    count += dp[j][i][i*a]

print(count)

### FIXED CODE ###

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

j = n
k = n
t = n * a
maxv = max(a, max(xlist))


dp = [[[0 for t in range(n*maxv + 1)] for k in range(k + 1)] for j in range(j + 1)]

dp[1][0][0] = 1
dp[0][0][0] = 1

# for d in dp:
#     print(d)
# print(dp[1][1][15])

for ji in range(0, j + 1):
    for ki in range(0, ji + 1):
        for ti in range(0, ki * maxv + 1):
            # print('now', ji, ki, ti)
            if ji == 0 and ki == 0 and ti == 0:
                # print('branch 1')
                dp[ji][ki][ti] = 1
            elif ji >= 1 and ti < xlist[ji - 1]:
                dp[ji][ki][ti] = dp[ji - 1][ki][ti]
                # print('branch 2')
            elif ji >= 1 and ki >= 1 and ti >= xlist[ji - 1]:
                # print('branch 3', ji - 1)
                dp[ji][ki][ti] = dp[ji - 1][ki][ti] + dp[ji - 1][ki - 1][ti - xlist[ji - 1]]
            # print(dp[ji][ki][ti])

count = 0
for i in range(1, k + 1):
    count += dp[j][i][i*a]

print(count)
s = list(map(int, input().split('/')))

if s[1] > 5:
    print('TBD')
elif s[i] <= 4:
    print('Heisei')

### FIXED CODE ###

s = list(map(int, input().split('/')))

if s[1] >= 5:
    print('TBD')
elif s[1] <= 4:
    print('Heisei')
a,b=input().split('\n')
n=int(a/2)
s=b
print('Yes' if s[:n]==s[n:] else 'No')

### FIXED CODE ###

n = int(input())
s = input()
if n % 2:
    print("No")
    exit()
half = s[0:n // 2]
print("Yes" if s == half + half else "No")
from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
input = sys.stdin.readline


def inp():
    return int(input())


def inpl():
    return list(map(int, input().split()))


N, M = inpl()

if N % 2 == 1:
    for i in range(M):
        print(i + 1, N - i - 1)
else:
    assert False
    if M == 1:
        print(1, 2)
    else:
        for i in range(M):
            if i == M - 1:
                print(i + 1, i + 3)
            else:
                print(i + 1, N - i)


### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9 + 7
eps = 10**-7
input = sys.stdin.readline


def inp():
    return int(input())


def inpl():
    return list(map(int, input().split()))


N, M = inpl()

if N % 2 == 1:
    for i in range(M):
        print(i + 1, N - i - 1)
else:
    if M == 1:
        print(1, 2)
    else:
        for i in range(M):
            a, b = i + 1, N - i
            if b - a <= N // 2:
                b -= 1

            print(a, b)
from itertools import combinations
import math
n = int(input()
ans = 0
for r in range(1,4): 
    
    if r>n:
        break
    for x  in combinations([x+1 for x in range(n)],r):
        print(x)
        if len(x)==1:
            ans += x[0]
        elif len(x)==2:
            ans += math.gcd(x[0],x[1])*6
        else:
            tmp = math.gcd(x[0],x[1])
            ans += math.gcd(x[2],tmp)*6
print(ans)

### FIXED CODE ###

from itertools import combinations
import math
n = int(input())
ans = 0
for r in range(1,4): 
    if r>n:
        break
    for x  in combinations([x+1 for x in range(n)],r):
        if len(x)==1:
            ans += x[0]
        elif len(x)==2:
            ans += math.gcd(x[0],x[1])*6
        else:
            tmp = math.gcd(x[0],x[1])
            ans += math.gcd(x[2],tmp)*6
print(ans)
A, B, C, D = map(int, input().split())

U = B - A + 1
U_c = U // C
U_d = U // D
U_cd = U // (C * D // gcd(C, D))

ans = U - (U_c + U_d - U_cd)
if A % 4 == 0 or B % 4 == 0:
    ans -= 1
print(ans)

### FIXED CODE ###

from fractions import gcd
A, B, C, D = map(int, input().split())
CD = C * D // gcd(C, D)

U = B - A + 1
U_c = (B // C) - (A // C) + int(A % C == 0)
U_d = (B // D) - (A // D) + int(A % D == 0)
U_cd = (B // CD) - (A // CD) + int(A % CD == 0)

ans = U - (U_c + U_d - U_cd)
print(ans)
if __name__=="__main__":
    [s] = map(int,input().split())
    if(a < 1200):
    	print("ABC")
    else:
	print("ARC")

### FIXED CODE ###

if __name__=="__main__":
    s = int(input())
    if(s < 1200):
        print("ABC")
    else:
        print("ARC")
from functools import reduce
from itertools import combinations
from fractions import gcd

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

def get_gcd(number_list):
    return reduce(gcd, number_list)

def L_gcd(i):
    if i == 0:
        return 0
    else:
        return gcd(A[i - 1], L_gcd(i - 1))
        
def R_gcd(i):
    if i == N:
        return 0
    else:
        return gcd(A[i], R_gcd(i + 1))


gcd_list = []
for i in range(N):
    Left = L_gcd(i)
    Right = R_gcd(i + 1)
    gcd_list.append(gcd(Left, Right))

#print(gcd_list)

print(int(max(gcd_list)))

### FIXED CODE ###

from functools import reduce
from itertools import combinations
from fractions import gcd

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


Left = [0] * (N + 1)
Right = [0] * (N + 1)

for i in range(N):
    Left[i + 1] = gcd(Left[i], A[i])
    Right[N - i - 1] = gcd(Right[N - i], A[N - i - 1])
ans = 0
for i in range(N):
    ans = max(ans, gcd(Left[i], Right[i + 1]))
    
print(ans)
T,X=map(int,input.split())
ans=T/X
print(ans)

### FIXED CODE ###

T,X=map(int,input().split())
ans=T/X
print(ans)
import math
A, B, K = map(int, input().split())
num = math.gcd(A,B)
a = [num]
for i in range(1,num):
    if num % i == 0:
        a.append(i)
b = sorted(a)
print(b[len(b)-K])

### FIXED CODE ###

a,b,k=map(int,input().split())
li=[]
for i in range(1,min(a,b)+1):
    if a%i==0 and b%i==0:
        li.append(i)
print(li[len(li)-k])
from collections import deque
from bisect import bisect_left

INF = 10**9 + 1
N = int(input())
A = list(map(int, input().split()))
G = [[] for i in range(N)]
for i in range(N-1):
    u, v = list(map(int, input().split()))
    G[u-1].append(v-1)
LIS = [INF] * N
ans = [0] * N

stack = deque()
stack.append((0, None, None))
while stack:
    c_node, p_node, old_val = stack.pop()

    if c_node == -1:
        print(c_node, p_node, old_val)
        LIS[p_node] = old_val
        print(c_node, LIS)
        continue

    a = A[c_node]
    idx = bisect_left(LIS, a)
    old_val = LIS[idx]
    LIS[idx] = a 
    
    ans[c_node] = bisect_left(LIS, INF)
    print(c_node, LIS)

    stack.append((-1, idx, old_val))

    for next_node in G[c_node]:
        stack.append((next_node, c_node, old_val))

print(*ans, sep="\n")

### FIXED CODE ###

from collections import deque
from bisect import bisect_left

INF = 10**9 + 1
N = int(input())
A = list(map(int, input().split()))
G = [[] for i in range(N)]
for i in range(N-1):
    u, v = list(map(int, input().split()))
    G[u-1].append(v-1)
    G[v-1].append(u-1)

LIS = [INF] * N
ans = [0] * N

stack = deque()
stack.append((0, None, None)) # (current_node, prev_node, old_val)
while stack:
    c_node, p_node, old_val = stack.pop()

    if c_node == -1:
        LIS[p_node] = old_val
        continue

    a = A[c_node]
    idx = bisect_left(LIS, a)
    old_val = LIS[idx]
    LIS[idx] = a 
    
    ans[c_node] = bisect_left(LIS, INF)

    stack.append((-1, idx, old_val))

    for next_node in G[c_node]:
        if next_node != p_node:
            stack.append((next_node, c_node, old_val))

print(*ans, sep="\n")
import numpy as np
n,x = map(int,input().split())
X = list(map(int,input().split()))
a = X[0]
X = np.array(X)
print(np.gcd.reduce(X-a))

### FIXED CODE ###

from functools import reduce
from fractions import gcd
n,x = map(int,input().split())
X = list(map(int,input().split()))
X = [abs(a-x) for a in X]
print(reduce(gcd,X))
S = input()
K = int(input())
s_list = list(map(int, list(S)))

for k in range(len(S)):
    if s_list[k] != 1:
        flag = True
        break

if flag:
    print(s_list[1])
else:
    print(1)
    

### FIXED CODE ###

S = input()
K = int(input())
s_list = list(map(int, list(S)))

flag = False
for k in range( min(len(S), K) ):
    if s_list[k] != 1:
        flag = True
        break

if flag:
    print(s_list[k])
else:
    print(1)
import sys
sys.setrecursionlimit(10**9)

x = input()
if len(x) < 3:
    print(0)

k = 0
if x[-3] == "0":
    k = 10
else:
    k = int(x[-3])

x = int(x[-2:])

products = [0, 1, 2, 3, 4, 5]

def dfs(comb_):
    if len(comb_) == k:
        return 1 if sum(comb_) == x else 0

    for product in products:
        comb = comb_[:]
        comb.append(product)
        if dfs(comb) == 1:
            return 1

    return 0

print(dfs([]))
        


### FIXED CODE ###

x = int(input())
for i in range(1,100000):
  if 100*i <= x <= 105*i:
    print(1)
    exit()
print(0)
(n, m) = list(map(int, input().split()))
p = list(map(int, input().split()))
cG = []
for i in range(0, m):
    e = list(map(int, input().split()))
    do = []
    for c in cG:
        if e[0] in c or e[1] in c:
            if not do == []:
                mix = do + c
                cG.remove(do)
                cG.remove(c)
                cG.append(mix)
                break
            else:
                do = c
        if e[0] in c:
            c.append(e[1])
        elif e[1] in c:
            c.append(e[0])
    if len(do) == 0:
        cG.append(e)

res = 0
bebe = [-1] * n
for i, c in enumerate(cG):
    for e in c:
        bebe[e - 1] = i

for i in range(n):
    if bebe[i] == bebe[p[i] - 1]:
        re += 1

print(res)


### FIXED CODE ###

def ge(x):
    return int(x) - 1


(n, m) = tuple(map(int, input().split()))
inp = list(map(ge, input().split()))
arr = [i for i in range(n)]


def root(a):
    global arr
    if arr[a] == a:
        return a
    else:
        tmp = root(arr[a])
        arr[a] = tmp
        return tmp


def sameroot(x, y):
    return root(x) == root(y)


def merge(x, y):
    global arr
    if not sameroot(x, y):
        arr[root(y)] = root(x)


for i in range(m):
    merge(*tuple(map(ge, input().split())))

res = 0
for i in range(n):
    if sameroot(i, inp[i]):
        res += 1
print(res)
a = []; b = []; c = []
n, m = map(int, input().split())

for i in range(n):
	row = map(int, input().split())
	a.append(list(row))

for j in range(m):
	col = int(input())
	b.append(col)

for k in range(n):
	temp = 0
	for l in range(m):
		temp += a[k][l] * b[l] 
	c.append(temp)

print(c[0])
print(c[1])
print(c[2])

### FIXED CODE ###

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

a = [list(map(int, input().split())) for i in range(n)]
b = [int(input()) for j in range(m)]

for a_row in a:
	print(sum(a_row[k] * b[k] for k in range(m)))
import math
n= int(input())
ans = 0
if math.sqrt(n) == int(math.sqrt(n)):
    for i in range(1,int(math.sqrt(n))):
        if (n-i) % i == 0:
            ans += (n-i) // i
else:
    for i in range(1,int(math.sqrt(n) + 1)):
        if (n-i) % i == 0:
            ans += (n-i) // i
print(ans)

### FIXED CODE ###

n,k = map(int,input().split())
print(n-k+1)
import math
 def comb(n, r):
 	return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
 base = comb(n+m, n * 2) + comb(n+m, m * 2)
 print(base)


### FIXED CODE ###

n, m = map(int, input().split())
import math
def comb(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
print(comb(n + m, 2) - n * m)
import heapq as hp
import numpy as np

h, w = map(int, input().split())
s = np.array([list(input()) for _ in range(h)])
s = np.pad(s, 1, 'constant')
visited = np.zeros_like(s, dtype=np.bool)

judge = np.inf

q = []
hp.heappush(q, (0, 1, 1))

while h:
    cnt, y, x = hp.heappop(q)
    if y == h and x == w:
        judge = cnt
        break
    for dy, dx in [[0, 1], [1, 0], [-1, 0], [0, -1]]:
        ny, nx = y + dy, x + dx
        if s[ny, nx] == '.' and not visited[ny, nx]:
            visited[ny, nx] = True
            hp.heappush(q, (cnt + 1, ny, nx))

if judge == np.inf:
    print(-1)
else:
    print((s == '.').sum() - judge - 1)


### FIXED CODE ###

from collections import deque

h, w = map(int, input().split())
s = [input() for _ in range(h)]

cnt = 0
for i in s:
    cnt += i.count('.')

queue = deque([[0, 0]])
visited = [[1] * w for _ in range(h)]
visited[0][0] = 0

def bfs():
    while len(queue) > 0:
        h1, w1 = queue.popleft()
        if h1 == h - 1 and w1 == w - 1:
            return visited[h1][w1]
        for k, l in ([1, 0], [-1, 0], [0, 1], [0, -1]):
            n_h, n_w = h1 + k, w1 + l
            if n_h < 0 or n_w < 0 or n_h >= h or n_w >= w:
                continue
            if visited[n_h][n_w] == 1 and s[n_h][n_w] == '.':
                queue.append([n_h, n_w])
                visited[n_h][n_w] += visited[h1][w1]
    return -1
    
bfs = bfs()
ans = 0
if bfs == -1:
    ans = -1
else:
    ans = cnt - bfs - 1
print(ans)
from sys import stdin

# stdin = open("testdata.txt", "r")

def input():
	return stdin.readline().strip()

from collections import deque

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

s = input()

def bfs(src):
	que = deque([[src, []]])
	visited = {src, }

	while que:
		u, path = que.popleft()
		if u == 0:
			return path
		for i in range(m, 0, -1):
			next_pos = u - i
			if next_pos not in visited and next_pos <= n and s[next_pos]=='0':
				visited.add(next_pos)
				que.append((next_pos, path+[i]))
	return -1

ans = bfs(n)
if ans == -1:
	print(ans)
else:
	print(*ans)

### FIXED CODE ###

N, M = map(int, input().split())
S = input().strip()
T = S[::-1]

l = []
i = 0
while i < N:
  t = T[i+1: i+M+1][::-1]
  if '0' not in t:
    print(-1)
    exit()
  else:
    x = min(M - t.index('0'), len(t))
    l.append(x)
    i += x
print(*l[::-1])
'''input
123 456
'''
# A coding delight
from sys import stdin
from collections import defaultdict
from math import gcd

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

# main starts
print(gcd(12, 2))
a, b = list(map(int, stdin.readline().split()))

print((a * b) // (gcd(a, b)))

### FIXED CODE ###

'''input
123 456
'''
# A coding delight
from sys import stdin
from collections import defaultdict

def gcd(a, b):
	if b == 0:
		return a
	else:
		return gcd(b, a % b)

# main starts
a, b = list(map(int, stdin.readline().split()))

print((a * b) // (gcd(a, b)))
n=input()

if n[0]==n[1]==n[2] or n[1]==n[2]==n[3] or n[2]==n[3]==n[4] or n[0]==n[1]==n[2]==n[3]:
    print("Yes")
else:
    print("No")


### FIXED CODE ###

n=input()

if n[0]==n[1]==n[2] or n[1]==n[2]==n[3]:
    print("Yes")
else:
    print("No")
def cc():
    a, b = map(str, input().split())
    a2 = int(a)
    b2 = int(b.replace('.', ''))
    c = a2 * b2
    print(str(c)[0:-2])

    if __name__ == "__main__":
    cc()


### FIXED CODE ###

def c():
    from decimal import Decimal
    import math
    a, b = map(str, input().split())
    print(int(math.floor(Decimal(a) * Decimal(b))))

if __name__ == "__main__":
    c()
from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)


### FIXED CODE ###

from fractions import gcd

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

fwd = [A[0]]
for i in range(1, N):
    fwd.append(gcd(fwd[-1], A[i]))

bwd = [A[-1]]
for i in range(N-2, -1, -1):
    bwd.append(gcd(bwd[-1], A[i]))
bwd.reverse()

gmax = max(fwd[-2], bwd[1])
for i in range(1, N-1):
    gmax = max(gmax, gcd(fwd[i-1], bwd[i+1]))

print(gmax)
A, B = map(int, input().split())
 
if B % A == 0：
    print(A + B)
else:
    print(B - A)
    

### FIXED CODE ###

A, B = map(int, input().split())
 
if B % A == 0:
    print(A + B)
else:
    print(B - A)
a, b, h = [int(input()) for i in range(4)]

print(round((a + b) * h / 2))

### FIXED CODE ###

a, b, h = [int(input()) for i in range(3)]

print(round((a + b) * h / 2))
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n, k, S):
    return S[:k-1]+S[k-1].lower()+S[k:]


do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    k = int(parsed_lines[0][1])
    S = parsed_lines[1][0]
    return n, k, S


if not do_submit:
    a, b, c = input_parse("""
    3 1
    ABC
    """)
    print(sol(a, b, c))

    a, b, c = input_parse("""
    4 3
    CABA
    """)
    print(sol(a, b, c))

else:
    n, k = list(map(int, input().split()))
    S = input().split()
    print(sol(n, k, S))
    # S = input().strip()
    # print(sol(S))


### FIXED CODE ###

from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(n, k, S):
    return S[:k-1]+S[k-1].lower()+S[k:]


do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    k = int(parsed_lines[0][1])
    S = parsed_lines[1][0]
    return n, k, S


if not do_submit:
    a, b, c = input_parse("""
    3 1
    ABC
    """)
    print(sol(a, b, c))

    a, b, c = input_parse("""
    4 3
    CABA
    """)
    print(sol(a, b, c))

else:
    n, k = list(map(int, input().split()))
    S = input().split()
    print(sol(n, k, S[0]))

    # S = input().strip()
    # print(sol(S))
n, k = list(map(int, input().split(" ")))

ans = 0
ans1 = 0
flag = False
for i in range(n, 0, -1):

    if(i >= k):
        ans1 += 1
        continue

    if(flag == False):
        flag = True
        j = 1
        while(i**(j+1) < k): j += 1

        tmp = j
        ans += 1
    else:
        while(i**(j+1) >= k): j -= 1
        j += 1

        if(tmp != j):
            ans *= 2
            ans += 1
            tmp = j
        else: ans += 1

print((ans+ans1*2**j) / (n*2**j))

### FIXED CODE ###

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

ans = 0
ans1 = 0
j = 1
flag = False
for i in range(n, 0, -1):

    if(i >= k):
        ans1 += 1
        continue

    if(flag == False):
        flag = True
        while(i*2**j < k): j += 1

        tmp = j
        ans += 1
    else:
        while(i*2**j >= k): j -= 1
        j += 1

        if(tmp != j):
            ans *= 2
            ans += 1
            tmp = j
        else: ans += 1

print((ans+ans1*2**j) / (n*2**j))
h,w = map(int,input().split())
c = [[] for i in range(0,h+2)]
ans = "Yes"
c[0] = ["#"for i in range(0,w+2)]
c[h+1] = ["#"for i in range(0,w+2)]
for i in range(1,h+1):
    d = []
    d = list(input())
    d.append("#")
    d.insert(0,"#")
    c[i] = d
for i in range(1,h+1):
    for j in range(1,w+1):
        if c[j][i] == "#":
            flag = "No"
            if(c[j][i-1] == "#"):
                flag = "Yes"
            if(c[j][i+1] == "#"):
                flag = "Yes"
            if(c[j-1][i] == "#"):
                flag = "Yes"
            if(c[j+1][i] == "#"):
                flag = "Yes"
            if(flag == "No"):
                ans = "No"
print(ans)


### FIXED CODE ###

h,w = map(int,input().split())
c = [[] for i in range(0,h+2)]
ans = "Yes"
c[0] = ["."for i in range(0,w+2)]
c[h+1] = ["."for i in range(0,w+2)]
for i in range(1,h+1):
    d = []
    d = list(input())
    d.append(".")
    d.insert(0,".")
    c[i] = d
for j in range(1,h+1):
    for i in range(1,w+1):
        if c[j][i] == "#":
            flag = "No"
            if(c[j][i-1] == "#"):
                flag = "Yes"
            if(c[j][i+1] == "#"):
                flag = "Yes"
            if(c[j-1][i] == "#"):
                flag = "Yes"
            if(c[j+1][i] == "#"):
                flag = "Yes"
            if(flag == "No"):
                ans = "No"
print(ans)
x,y=map(int,input().split())
mod=10**9+7

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
def mod_combinations_cont(n, r, mod):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

if (x+y)%3!=0:
    print(0)
else:
    n=(x+y)//3
    m=(-x+2*y)/3
    if n<0 or m<0:
        print(0)
        exit()
    else:
        print(mod_combinations_cont(n,m,mod)%mod)


### FIXED CODE ###

x,y=map(int,input().split())
mod=10**9+7

def modinv(a, mod=10**9+7):
    return pow(a, mod-2, mod)
def mod_combinations_count(n, r, mod):
    r = min(r, n-r)
    res = 1
    for i in range(r):
        res = res * (n - i) * modinv(i+1, mod) % mod
    return res

if (x+y)%3!=0:
    print(0)
else:
    n=(x+y)//3
    m=(-x+2*y)//3
    if n<0 or m<0 or n<m:
        print(0)
        exit()
    else:
        print(mod_combinations_count(n,m,mod)%mod)
s = ''
count = 0
while S:
    if s == S[-1]:
        if len(S) >= 2:
            S.pop()
            S.pop()
            s = ''
            count+=1
        else:
            break        
    else:
        s = S.pop()
        count+=1
        
print(count)

### FIXED CODE ###

S = list(input())

s = ''
count = 0
while S:
    if s == S[-1]:
        if len(S) >= 2:
            S.pop()
            S.pop()
            s = ''
            count+=1
        else:
            break        
    else:
        s = S.pop()
        count+=1
        
print(count)
from itertools import permutations

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))
num_P = 0
num_Q = 0

li = list(permutations(range(1, N + 1)))

#print(P, Q, li)
print(abs(li.index(P) - li.index(Q)))
#print(li)
#print(li.index(P))
#print(li.index(Q))

### FIXED CODE ###

K, X = map(int, input().split())

if 500 * K >= X:
  print('Yes')
else:
  print('No')
import math

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

digit = math.floor(math.log2(max(A))) + 1

ans = 0
for i in range(digit):
    num1 = len([1 for j in range(N) if A[j] & 2**i])
    num0 = N - num1

    ans += ((num1 * num0) * (2 ** i))

print(ans % (10 ** 9 + 7))

### FIXED CODE ###

import math

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

ans = 0
fil = 1
for i in range(60):
    num1 = len([1 for j in range(N) if A[j] & fil])
    num0 = N - num1
    ans += (num1 * num0) * fil
    fil <<= 1

print(ans % (10 ** 9 + 7))
from collections import Counter
N, K = map(int, input().split())
A = list(map(int, input().split()))
A = Counter(A)
A = sorted(A.values())
print(sum[A[:len(A) - k]])



### FIXED CODE ###

i = input()
print(int(i[0] == '1') + int(i[1] == '1') + int(i[2] == '1'))
result = 0
if(0<N<=pow(10,5)):
    if len(str(N)) % 2 == 0:
        loop = ((len(str(N)) - 1) -1) //2 + 1
        for i in range(loop):
            result += 9 * pow(10,2*i)
    else:
        for i in range(len(str(N)) - 2):
            result += 9 * pow(10,i)
        result += N - pow(10,len(str(N)) - 1) + 1

print(result)

### FIXED CODE ###

N = int(input())

print(sum(len(str(i)) % 2 for i in range(1,N+1)))