Harryxun/stf_run huggingface dataset:
import math

def nCr(n,r):
    f = math.factorial
    return int(f(n) / f(r) / f(n-r))

def nHk(n, k):
    f = math.factorial
    return int(f(n + k - 1) // f(k) // f(n - 1))

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
    print('i: ' + str(i))
    # 青玉をi個のグループに並べる並べ方
    blue = 1
#    if i == 1:
#        blue = 1
#    else:
#        blue = nCr(K - 1, i - 1)
#    print('blue: ' + str(blue))
    # 青い玉に合わせた赤い玉の並べ方
    if (N - K) < (i - 1):
        red = 0
#        print('red0: ' + str(red))
    elif i == 1:
        red = (N - K) + 1
        print('red1: ' + str(red))
    else:
        red = nCr(K - 1, i - 1) * nHk(i + 1, N - K - i - 1)
#        print('nCr: ' + str(nCr(K - 1, i - 1)))
#        print('nHk: ' + str(nHk(i + 1, N - K - (i - 1))))
#        print('red2: ' + str(red))

    # 解は青の並べ方と赤の並べ方の組み合わせ
    ans = blue * red % MOD
    print(ans)

### FIXED CODE ###

from operator import mul
from functools import reduce

def nCr(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

N, K = map(int, input().split())
MOD = 10 ** 9 + 7

for i in range(1, K + 1):
    if i > N - K + 1:
        ans = 0
    else:
        ans = nCr(K - 1, i - 1) * nCr(N - K + 1, i) % MOD
    print(ans)
x - int(input())
if x in [3,5,7]:
  print('YES')
else:
  print('NO')

### FIXED CODE ###

x = int(input())
if x in [3,5,7]:
  print('YES')
else:
  print('NO')
S = input()
Q = int(input())

buf = [0] * (2*(10**5)+10)
for i, s in enumerate(S):
    buf[i] = s

is_reverse = False
first = 0
last = len(S) - 1

def add_top(c):
    global buf
    global first
    if is_reverse:
        first += 1
    else:
        first -= 1
    buf[first] = c

def add_tail(c):
    global buf
    global last
    if is_reverse:
        last -= 1
    else:
        last += 1
    buf[last] = c

for i in range(Q):
    Query = input().split()
    t = int(Query[0])
    if t == 1:
        is_reverse = not is_reverse
        first, last = last, first
    else:
        f = int(Query[1])
        c = Query[2]
        if f == 1:
            add_top(c)
        else:
            add_tail(c)

ans = ''
#print(is_reverse, first, last)
#print(buf[first])
#print(buf[last])
if is_reverse:
    l = list(reversed(buf[:first+1]))
    #print(l)
    l[len(l):] = list(reversed(buf[last:]))
    #print(l)
    #ans = ''.join(buf[last:first+1:-1])
    ans = ''.join(l)
else:
    l = buf[first:]
    #print(l)
    l[len(l):] = buf[:last+1]
    #print(l)
    #ans = ''.join(buf[first:last+1])
    ans = ''.join(l)
print(ans) 


### FIXED CODE ###

S = input()
Q = int(input())

buf = [0] * (3*(10**5)+10)
for i, s in enumerate(S):
    buf[i] = s

is_reverse = False
first = 0
last = len(S) - 1

def add_top(c):
    global buf
    global first
    if is_reverse:
        first += 1
    else:
        first -= 1
    buf[first] = c

def add_tail(c):
    global buf
    global last
    if is_reverse:
        last -= 1
    else:
        last += 1
    buf[last] = c

for i in range(Q):
    Query = input().split()
    t = int(Query[0])
    if t == 1:
        is_reverse = not is_reverse
        first, last = last, first
    else:
        f = int(Query[1])
        c = Query[2]
        if f == 1:
            add_top(c)
        else:
            add_tail(c)

ans_list = []
p = first
while True:
    ans_list.append(buf[p])
    if p == last:
        break
    if is_reverse:
        p -= 1
    else:
        p += 1
ans = ''.join(ans_list)
print(ans)
n, k = map(int, input().split())
s = input()
segment = 0
now = '#'
ans = 0
for i in range(s):
    if i==now:
        segment+=1
        now = i
    else:
        ans+=1
for i in range(k):
    t = 0
    if segment > 2:
        t = 2
    elif segment == 2:
        t = 1
    segment, ans = segment-t, ans+t
print(ans)


### FIXED CODE ###

n, k = map(int, input().split())
s = input()
segment = 0
now = '#'
ans = 0
for i in s:
    if i!=now:
        segment+=1
        now = i
    else:
        ans+=1
for i in range(k):
    t = 0
    if segment > 2:
        t = 2
    elif segment == 2:
        t = 1
    segment, ans = segment-t, ans+t
print(ans)
N,M = map(int,input().split())
Alist = list(map(int, input().strip().split()))
r = list(range(len(Alist)))
r[0] = Alist[0]
for i in range(1,len(Alist)):
    r[i] = r[i-1] + Alist[i]
for i in range(len(r)):
    r[i] = r[i]%M
p = [0] * M
for i in range(len(r)):
    p[r[i]] = p[r[i]] + 1
def kaijou(n):
    if n == 0:
        return 1
    else:
        v = n
        for i in range(1,n):
            v = v*i
        return v      
def combi(n):
    if n == 0:
        return 0
    if n == 1:
        return 0
    else:
        return kaijou(n)/((kaijou(n-2))*2)
s = 0
for i in range(len(p)):
    s = s + combi(p[i])
s = s + p[0]
print(int(s))

### FIXED CODE ###

N,M = map(int,input().split())
Alist = list(map(int, input().strip().split()))
r = [0]*N
r[0] = Alist[0]
for i in range(1,len(Alist)):
    r[i] = r[i-1] + Alist[i]
for i in range(len(r)):
    r[i] = r[i]%M
r.sort()
p = []
m = 0
for i in range(len(r)-1):
    m = m+1
    if r[i] != r[i+1]:
        p.append(m)
        m = 0
    if i == len(r)-2:
        p.append(m+1)
x = 0
for i  in range(len(r)):
    if r[i] == 0:
        x = x +1
def combi(n):
    if n == 0:
        return 0
    if n == 1:
        return 0
    else:
        return (n*(n-1))/2
s = 0
for i in range(len(p)):
    s = s + combi(p[i])
s = s + x
print(int(s))
# C
n = int(input()) 
a = list(map(int, input().split()))

import functools
import math

gcd = functools.reduce(math.gcd, a)
print(gcd)

### FIXED CODE ###

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

from functools import reduce
def gcd(a,b):
    if a<b:a,b=b,a
    if a%b==0:return b
    return gcd(b,a%b)

gcd=reduce(gcd,a)
print(gcd)
a, b, c = input().split()

if a[-1] == b[1] and b[-1] == c[1]:
    print("YES")
else:
    print("NO")

### FIXED CODE ###

a, b, c = input().split()

if a[-1] == b[0] and b[-1] == c[0]:
    print("YES")
else:
    print("NO")
import scipy
import math

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

M = m
lst, count = [],[]
for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans = ans * scipy.special.comb(i+n-1,i)
    ans = ans % (10**9+7) 

print(int(ans))

### FIXED CODE ###

import scipy.misc
import math

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

M = m
lst, count = [],[]
if M == 1:
    print(1)
else:
    for i in range(2,int(math.sqrt(m))+1):
        while M % i == 0:
            M = M // i
            if i not in lst:
                count.append(1)
                lst.append(i)
            else:
                count[-1] += 1
    if M > 1:
        lst.append(M)
        count.append(1)       

    ans = 1
    for i in count:
        ans = ans * scipy.misc.comb(i+n-1,i, exact=1)
        ans = ans % (10**9+7) 

    print(int(ans))
N = int(input())
data = [0]*N
for i in range(0,N): data[i] = int(input())

import math

ans = data[0]
for i in range(0,N):
    ans = ans*data[i]//math.gcd(ans,data[i])

print(ans)

### FIXED CODE ###

N = int(input())
data = [0]*N
for i in range(0,N): data[i] = int(input())

import fractions

ans = data[0]
for i in range(0,N):
    ans = ans*data[i] // fractions.gcd(ans,data[i])

print(ans)
#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

x = list(map(int , input().split()))
for i in range(x):
	if x[i] == 0:
		print(i+1)
		exit()









### FIXED CODE ###

#: Author - Soumya Saurav
import sys,io,os,time
from collections import defaultdict
from collections import OrderedDict
from collections import deque
from itertools import combinations
from itertools import permutations
import bisect,math,heapq
alphabet = "abcdefghijklmnopqrstuvwxyz"

input = sys.stdin.readline

########################################

x = list(map(int , input().split()))
for i in range(len(x)):
	if x[i] == 0:
		print(i+1)
		exit()
abck=list(map(int,input().split()))
a=abck[0]
b=abck[1]
c=abck[2]
k=abck[3]

if a>=k:
    print(a)
elif a<k:
    if a+b>k:
        print(a)
    else:
        print(a-(k-a-b))

### FIXED CODE ###

S=input()
T=input()

if S==T[0:len(T)-1]:
    print('Yes')
else:
    print('No')
import math

def comb(n, r):
  if n >=r:
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))
  else:
    return 0
      
n,m = map(int,input().split())
a = [0]*m
b = [0]*m
for i in range(m):
  u,v = map(int, input().split())
  a[i] = u-1
  b[i] = v-1
par = [i for i in range(n)]
size = [1]*n
incomb = [comb(n,2)]*(m+1)

def root(x):
  if par[x] == x: 
    return x
  else:
    par[x] = root(par[x])
    return par[x]
    
def isSame(x,y):
  return par[x] == par[y]

def union(x,y):
  x = root(x)
  y = root(y)
  if x == y:
    return
  else:
    par[y] = x
    size[x] += size[y]
    
def size_count(x):
  return size[root(x)]

for i in reversed(range(m)):
  q_a = a[i]
  q_b = b[i]
  size_a = size_count(q_a)
  size_b = size_count(q_b)
  if not isSame(q_a,q_b):
    union(q_a,q_b)
    incomb[i] = incomb[i+1] - size_a*size_b
  else:
    incomb[i] = incomb[i+1]
incomb.pop(0)
for i in incomb:
  print(i)

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n,m = map(int,input().split())
a = [0]*m
b = [0]*m
for i in range(m):
  u,v = map(int, input().split())
  a[i] = u-1
  b[i] = v-1
par = [i for i in range(n)]
size = [1]*n
incomb = [n*(n-1)//2]*m

def root(x):
  if par[x] == x: 
    return x
  else:
    par[x] = root(par[x])
    return par[x]
    
def isSame(x,y):
  return par[x] == par[y]

def union(x,y):
  x = root(x)
  y = root(y)
  if x == y:
    return
  else:
    par[y] = x
    size[x] += size[y]
    
def size_count(x):
  return size[root(x)]

for i in reversed(range(1,m)):
  q_a = a[i]
  q_b = b[i]
  size_a = size_count(q_a)
  size_b = size_count(q_b)
  if not isSame(q_a,q_b):
    union(q_a,q_b)
    incomb[i-1] = incomb[i] - size_a*size_b
  else:
    incomb[i-1] = incomb[i]

for i in incomb:
  print(i)
def main():
    t = input()
    if t == "1":
        print(1)
        exit(0)
    li = [int(v) for v in input().split(' ')]
    s_li = sorted(li)
    count = 0
    for v in s_li:
        v_1 = s_li.count(v - 1)
        v_0 = s_li.count(v) + s_li.count(v + 1)
        v_2 = s_li.count(v + 2)
        t_c = v_1 + v_0
        t_c2 = v_2 + v_0

        if t_c > count:
            count = t_c
        if t_c2 > count:
            count = t_c2
        if count > len(s_li):
            break
        s_li = s_li[s_li.index(v + 1):]
    print(count)


if __name__ == '__main__':
    main()

### FIXED CODE ###

n = int(input())
cnt = [0] * 100002
a = list(map(int, input().split()))
for v in a:
    cnt[v] += 1
    cnt[v+1] += 1
    cnt[v+2] += 1
    
print(max(cnt))
N = int(input())

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

A.sort()
B.sort()
C.sort()

tmp_b = 0
tmp_c = 0
max_b = B[-1]
max_c = C[-1]
ans = 0
for i in range(N):
    flg = False
    tmp = A[i]
    if tmp >= max_b:
        break
    while True:
        if B[tmp_b] > tmp:
            tmp = B[tmp_b]
            break
        else:
            tmp_b += 1
    while True:
        if C[tmp_c] > tmp:
            break
        else:
            tmp_c += 1
    k = tmp_c
    for j in range(tmp_b, N):
        if B[j] >= max_c or flg:
            break
        else:
            while True:
                if B[j] < C[k]:
                    ans += N-k
                    break
                else:
                    k += 1
                    if k == N:
                        flg = True
                        break

print(ans)


### FIXED CODE ###

import bisect
N = int(input())

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

ans = 0
for b in B:
    a = bisect.bisect_left(A, b)
    c = bisect.bisect_right(C, b)
    ans += a*(N-c)
print(ans)
n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_ruiseki = []
if A[0]<=k:
    A_ruiseki.append(A[0])
    for i in range(1, n):
        if A_ruiseki[i-1]+A[i] <= k :
            A_ruiseki.append(A_ruiseki[i-1]+A[i])
        else:
            break

B_ruiseki = []
if B[0]<=k:

    B_ruiseki.append(B[0])
    for i in range(1, n):
        if B_ruiseki[i-1]+B[i] <= k :
            B_ruiseki.append(B_ruiseki[i-1]+B[i])
        else:
            break

ans = len(A_ruiseki)

for i in range(len(A_ruiseki)):
    time = A_ruiseki[i]
    expected = max(ans-i-2, 0)

    if len(B_ruiseki) <= expected:
        continue
    if time + B_ruiseki[expected] > k:
        continue
    if expected > 0:
        time += B_ruiseki[expected-1]
    for j in range(expected, len(B)):

        if time + B[j] > k:
            break

        time += B[j]

        ans =i+2+j

print(ans)

### FIXED CODE ###

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

A_ruiseki = [0]
for i in range(n):
    if A_ruiseki[-1]+A[i] <= k :
        A_ruiseki.append(A_ruiseki[-1]+A[i])
    else:
        break

B_ruiseki = [0]
for i in range(m):
    if B_ruiseki[-1]+B[i] <= k :
        B_ruiseki.append(B_ruiseki[-1]+B[i])
    else:
        break

ans = len(A_ruiseki)-1

for i in range(len(A_ruiseki)):
    time = A_ruiseki[i]
    expected = max(ans-i, 0)

    if len(B_ruiseki) <= expected:
        continue

    if time + B_ruiseki[expected] > k:
        continue

    time += B_ruiseki[expected]

    for j in range(expected, len(B)):
        if time + B[j] > k:
            break

        time += B[j]
        ans =i+j+1

print(ans)
import math

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

datanum = B - A + 1
depth = int(math.ceil(math.log2(datanum)))
#print("datanum = {}, depth = {}".format(datanum, depth))
a = [[0] * (2 ** depth) for i in range(depth + 1)]
a[0][0:datanum] = range(A, B + 1)
#print("a = ")
#print(a)

cnt = int(2 ** depth)
for i in range(depth):
#    print("cnt = " + str(cnt))
    k = 0
    for j in range(0, cnt, 2):
#        print("[{}][{}] <- [{}][{}] ^ [{}][{}]".format(i + 1, k, i, j, i, j + 1))
        a[i + 1][k] = a[i][j] ^ a[i][j + 1]
        k = k + 1
    cnt = cnt // 2
ans = a[depth][0]

print(ans)


### FIXED CODE ###

def func(a):
    if(0 == a % 4):
        return(a)
    if(1 == a % 4):
        return(1)
    if(2 == a % 4):
        return(a + 1)
    if(3 == a % 4):
        return(0)

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

print(func(A - 1) ^ func(B))
nums = list(map(int, input().split()))
 t = nums[2]
 if (nums[0] <= t and nums[1] >= t):
     print('Yes')
 else:
     print('No')

### FIXED CODE ###

nums = list(map(int, input().split()))
t = nums[2]
if (nums[0] <= t and nums[1] >= t):
    print('Yes')
else:
    print('No')
N = int(input())
S = input()
A = []
for i in range(S):
  if chr(ord(S[i])+N) <= 90:
    A.append(ord(S[i]+N)
  else :
    A.append(ord(S[i]+N-26)
    

### FIXED CODE ###

N = int(input())
S = input()
A = ''
for i in range(len(S)):
    if ord(S[i])+N <= 90:
        A += chr(ord(S[i])+N)
    
    else:
        A += chr(ord(S[i])+N-26)
        
print(A)
while True:
    x, y, s = map(int, raw_input().split())

    if x == 0 and y == 0 and s == 0:
        break

    ans = 0

    for i in range(1, s):
        for j in range(1, s):
            a = i * (100 + x) / 100;
            b = j * (100 + x) / 100;

            if a + b != s:
                continue

            ans = max(ans, i * (100 + y) / 100 + j * (100 + y) / 100)

    print ans



### FIXED CODE ###

while True:
    x, y, s = map(int, raw_input().split())

    if x == 0 and y == 0 and s == 0:
        break

    ans = 0

    for i in range(1, s):
        for j in range(1, s-i+1):
            if int(i * (100 + x) / 100.0) + int(j * (100 + x) / 100.0) == s:
                ans = max(ans, int(i * (100 + y) / 100.0) + int(j * (100 + y) / 100.0))

    print ans
list = input()
a = int(list[0])
b = int(list[1])

if(a > b):
    print("a > b")
elif(a == b):
    print("a == b")
else:
    print("a < b")

### FIXED CODE ###

list = input().split(" ")
a = int(list[0])
b = int(list[1])

if a > b:
    print("a > b")
elif a == b:
    print("a == b")
else:
    print("a < b")
while True:
     (H, W) = [int(x) for x in input().split()]
     if H == W == 0:
         break

     for wc in range(W):
         for hc in range(H):
             print('#', end = ' ')

        print()

    print()

### FIXED CODE ###

while True:
    H,W = map(int, input().split())
    if W == H == 0:
        break;
    L="#"*W
    for i in range(H):
        print(L)
    print("")
nums = [int(i) for i in input().split()]
nums_sort = sorted(nums)
nums_str = map(str, nums)
print "{}" "{}" "{}".format(nums_str)

### FIXED CODE ###

nums = [int(i) for i in input().split()]
nums_sort = sorted(nums)
nums_str = map(str, nums_sort)
print (' '.join(nums_str))
from math import pi

input1 = list(map(int,input("").split(" ")))
N = int(input(""))
src = {"x":input1[0],"y":input1[1]}
dist = {"x":input1[2],"y":input1[3]}

spring = []
for i in range(N):
	temp = list(map(int,input("").split(" ")))
	if temp[0] in range(min(src['x'],dist['x']),max(src['x'],dist['x'])+1):
		if temp[1] in range(min(src['y'],dist['y']),max(src['y'],dist['y'])+1):
			spring.append({'x':temp[0], 'y':temp[1]})

# print(spring)
path = (abs(src['x']-dist['x']) + abs(src['y']-dist['y'])) * 100
if len(spring) > 0:
	r = 10
	if src['x'] == dist['x'] or src['y'] == dist['y'] :
		#半円
		path += r*pi - 2*r 
	else:
		#1/4円
		if (src['x']-dist['x'])*(src['y']-dist['y']) > 0:
			spring.sort(key=lambda k: k['x'])
		else:
			spring.sort(key=lambda k: k['x'], reverse=True)
		L = [spring[0]['y']]
		length = 1
		for i in range(1,len(spring)):
			if L[length-1] < spring[i]['y']:
				L.append(spring[i]['y'])
				length += 1
			else:
				for j in range(length):
					if spring[i]['y'] <= L[j]:
						L[j] = spring[i]['y']
						break
		path += (r*pi/2 - 2*r) * length

print(path)


### FIXED CODE ###

input1 = input("").split(" ")
Q = int(input1[0])
H = int(input1[1])
S = int(input1[2])
D = int(input1[3])
N = int(input(""))

print((N%2) * min(Q*4,H*2,S) + (N//2) * min(Q*8,H*4,S*2,D))
def factorization(y):
    arr = []
    temp = y
    for i in range(2, int(-(-y**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([y, 1])
    return arr
n=int(input())
if n==1:
  print(0)
  exit()

ans=0
l=factorization(n)
for i,j in l:
    if j<=2:
      ans+=1
    else:
      c=1
      t=1
      while j>0:
        ans+=1
        j-=c
        c+=t
        if j<t:
          break
        t+=1     
print(ans)

### FIXED CODE ###

a,b=input().split()
a=int(a)
b1,b2=map(int,b.split('.'))
b=b1*100+b2
c=a*b//100
print(c)
a, b, k = map(int, input().split())
mx = max(a, b) * 0.5
match, ans = 0, 0

for i in range(mx):
    if ((a % (mx - i)) == 0) 
    and ((b % (mx - i)) == 0):
        match += 1
        ans = mx - i
        
        if match == k:
            break
print(ans)


### FIXED CODE ###

a, b, k = map(int, input().split())
mx = max(a, b)
match, ans = 0, 0

for i in range(mx):
    if ((a % (mx - i)) == 0) and ((b % (mx - i)) == 0):
        
        match += 1
        ans = mx - i
        
        if match == k:
            break
print(ans)
N = int(input())
lst_monsters = map(int, input().split())

import math
from functools import reduce
# def gcd(*lst):
#     return reduce(math.gcd, lst)

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

ans = gcd_list(lst_monsters)
print(ans)

### FIXED CODE ###

# import math
import fractions
from functools import reduce

def gcd_list(lst):
    # return reduce(math.gcd, lst)
    return reduce(fractions.gcd, lst)

N = int(input())
lst_monsters = map(int, input().split())
print(gcd_list(lst_monsters))
n=int(input())
s=input()
ans=0
r=g=b=0
R=[0 for _ in range(n)]
G=[0 for _ in range(n)]
B=[0 for _ in range(n)]
for i in range(i):
    if s[i]='R':r+=1
    elif s[i]='G':g+=1
    else:b+=1
    R[i]=r
    G[i]=g
    B[i]=b
for i in range(n):
    if s[i]='R':ans+=G[i]*(B[-1]-B[i])+B[i]*(G[-1]-G[i])
    elif s[i]='G':ans+=R[i]*(B[-1]-B[i])+B[i]*(R[-1]-R[i])
    else:ans+=R[i]*(G[-1]-G[i])+G[i]*(R[-1]-R[i])
print(ans)

### FIXED CODE ###

from collections import Counter as C
n=int(input())
S=list(input())
a=1
L=C(S).most_common(3)
for l in L:
  a*=l[1]
for i in range(1,n):
  for j in range(n-2*i):
    if len(set((S[j],S[j+i],S[j+2*i])))==3:
      a-=1
print(a if len(L)>2 else 0)
#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    count = 0
    while True:
        N = N // K
        if N >= 1:
            count += 1
        else:
            break
    print (cont)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()


### FIXED CODE ###

#!/usr/bin/env python3
import sys


def solve(N: int, K: int):
    count = 0
    while True:
        N = N // K
        if N >= 1:
            count += 1
        else:
            break
    print (count+1)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(N, K)

if __name__ == '__main__':
    main()
import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 0
for i in range(0, len(s)):
    u = u + t[i]
if u == 26:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

import copy
s = list(input())
def make1d(n):
    return [copy.deepcopy(1) for i in range(0,n)]
t = make1d(26)
for i in range(0, len(s)):
    t[ord(s[i]) - 97] = t[ord(s[i]) - 97] * (-1)
u = 0
for i in range(0, len(t)):
    u = u + t[i]
if u == 26:
    print('Yes')
else:
    print('No')
N = int(input())
M = [[i for i in input().split()] for i in range(N)]
C = 0

for i in range(N):
    if M[i][1] == 'JPY':
        C += int(M[i][0])
    elif M[i][1] == 'BTC':
        C += float(M[i][0])*380000

print(C)

### FIXED CODE ###

y, m ,d = map(int, input().split('/'))

A = None

if y > 2019 :
    A = 'TBD'
elif m > 4 :
    A = 'TBD'
elif d > 30 :
    A = 'TBD'
else:
    A = 'Heisei'
    
print(A)
# map関数:map(関数,リスト) リストのすべての要素に関数を適用する
# split関数:変数名.split() 変数を区切る
# split関数は文字列型の為、数字に認識させるためにintを入れる
answer = a * b

print(answer)

### FIXED CODE ###

# 169A
# A * B を整数として出力せよ

# 1.　入力をプログラムで扱えるように受け取ること
a, b = map(int, input().split())
# print(a, b)

# 2.　受け取った入力値を使って、適切に処理（計算）すること
answer = a * b

# 3.　計算した結果を出力する
print(answer)
list = input().split(" ")
N = int(list[0])
A = int(list[1])
B = int(list[2])

num1 = N // (A + B)
num2 = N % (A + B)
if num2 <= A:
    print(num1 * A + num2)
else:
    print(num1 * A + A)

### FIXED CODE ###

S = input()
if S == "AAA":
    print("No")
elif S == "BBB":
    print("No")
else:
    print("Yes")