Harryxun/stf_run huggingface dataset:
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
ans=0

    
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)

for num in lst:
    x=lst.count(num)
    if x==0:
        break
    if x==1:
        if num==0:
            ans+=1
    elif num!=0:
        ans+=conv(x,2)
    elif num==0:
        ans+=x+conv(x,2)
    
    lst=[i for i in lst if i!=num]
    
    
    

print(ans)

### FIXED CODE ###

import collections
n=int(input())
A=list(map(int,input().split()))
x=0
lst=[]
for i in range(n):
    x+=A[i]
    lst.append(x)
c=collections.Counter(lst)

 
def conv(n,m):
    if n==m or m==0:
        return 1
    else:
        return conv(n-1,m-1)+conv(n-1,m)
ans=0
for k in c.keys():
    if c[k]==1:
        if k==0:
            ans+=1
        else:
            continue
    elif k==0:
        ans+=c[k]+int(c[k]*(c[k]-1)/2)
    else:
        ans+=int(c[k]*(c[k]-1)/2)
print(ans)
n, a, b = map(int, input().split())
ans = ""
while True:
  ans += "b" * a
  ans += "r" * b
  if len(ans) >= n:
    break
print(ans[:n].count("b"))

### FIXED CODE ###

n, a, b = map(int, input().split())
ans = n // (a+b) * a
mod = n % (a+b)
print(ans + min(a, mod))
import sys
sys.setrecursionlimit(10**9)

N, M = map(int, input().split())

Map = [[] for _ in range(M)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x, pre):
    global cnt
    reached[x] = True

    if all(reached):
        cnt += 1

    for i in range(N):
        if i==pre or reached[i]:
            continue

        if i in Map[x]:
            DFS(i, x)

    reached[x] = False

DFS(0,-1)
print(cnt)


### FIXED CODE ###

N, M = map(int, input().split())

Map = [[] for _ in range(N)]
reached = [False]*N

for _ in range(M):
    aa, bb = map(int, input().split())
    Map[aa-1].append(bb-1)
    Map[bb-1].append(aa-1)

cnt = 0

def DFS(x):
    global cnt
    global reached

    reached[x] = True

    if all(reached):
        cnt += 1
        reached[x] = False

        return

    for i in Map[x]:
        if reached[i]:
            continue

        else:
            DFS(i)

    reached[x] = False


DFS(0)
print(cnt)
cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
}

n = int(input())
for _ in range(n):
    (s, r) = input().split()
    r = int(r)
    cards[s][r - 1] = r
print(data)

for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print('{0:s} {1:d}.format(s, r+1))

### FIXED CODE ###

cards = {
        'S': [0 for _ in range(13)],
        'H': [0 for _ in range(13)],
        'C': [0 for _ in range(13)],
        'D': [0 for _ in range(13)],
        }
  
n = int(input())
for _ in range(n):
    (s, r) = input().split()
    r = int(r)
    cards[s][r - 1] = r
  
for s in ('S', 'H', 'C', 'D'):
    for r in range(13):
        if cards[s][r] == 0:
            print( '{0:s} {1:d}'.format(s, r+1))
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

from operator import mul
from functools import reduce



def main():
    n, k = list(map(int, input().split()))
    modulo = 1000_000_000 + 7

    def cmb(n, r):
        if n < r:
            return 0
        r = min(n - r, r)
        if r == 0:
            return 1
        numer = reduce(mul, range(n, n - r, -1))
        denom = reduce(mul, range(1, r + 1))
        return numer // denom % modulo

    for i in range(1, k+1):
        # i分割する方法
        a = cmb(k-1, i-1)
        # 赤のボールを分割する方法
        b = cmb(n-k+1, i)
        print(a * b % modulo)

main()



### FIXED CODE ###

import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline

def main():
    s = input().strip()
    a = s[0] ; b = None
    c = 1 ; d = 0

    for i in range(1, 4):
        if s[i] == a:
            c += 1

        elif b == None:
            b = s[i]
            d += 1

        elif s[i] == b:
            d += 1

    if c == 2 and d == 2:
        print('Yes')
    else:
        print('No')

main()
import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    X_list = [int(i) for i in input().strip().split()]
    sorted_x = sorted(X_list)

    left = sorted_x[(N // 2)-1]
    right = sorted_x[N // 2]
    print(left, right)
    for x in X_list:
        if X_list[x-1] <= left:
            print(right)
        else:
            print(left)


if __name__ == "__main__":
    main()


### FIXED CODE ###

import sys
input = sys.stdin.readline
# sys.setrecursionlimit(100000)


def main():
    N = int(input().strip())
    X_list = [int(i) for i in input().strip().split()]
    sorted_x = sorted(X_list)

    left = sorted_x[(N // 2)-1]
    right = sorted_x[N // 2]
    for x in X_list:
        if x <= left:
            print(right)
        else:
            print(left)


if __name__ == "__main__":
    main()
from math import factorial

n, a, b = map(int, input().split(" "));
v = list(map(int, input().split(" ")))

def product(iterable):
    prod = 1
    for n in iterable:
        prod *= n
    return prod

def npr(n, r):
    return product(range(n - r + 1, n + 1))

def ncr(n, r):
    if r > n // 2:
        r = n - r
    return npr(n, r) // factorial(r)

v.sort();
revv=list(reversed(v))
print(sum(v[-a:])/a)

revpos=revv.index(v[-a]);
num=v.count(v[-a]);
ans=0;
for i in range(a-revpos, b-revpos+1):
    ans+=ncr(num, i);
print(ans);


### FIXED CODE ###

from math import factorial

n, a, b = map(int, input().split(" "));
v = list(map(int, input().split(" ")))

def product(iterable):
    prod = 1
    for n in iterable:
        prod *= n
    return prod

def npr(n, r):
    return product(range(n - r + 1, n + 1))

def ncr(n, r):
    if r > n // 2:
        r = n - r
    return npr(n, r) // factorial(r)

v.sort();
revv=list(reversed(v))
print(sum(v[-a:])/a)
revpos=revv.index(v[-a]);
num=v.count(v[-a]);
ans=0
if v[-1] == v[-a] == v[-a-1]:
    for i in range(a-revpos, b-revpos+1):
        if i > num:
            continue;
        ans+=ncr(num, i);
    print(ans);    
else:
    print(ncr(num,a-revpos));
H, W, A, B = map(int, input().split())
grid = [[0] * W for _ in range(H)]
cnt = [0] * W
w = 0
for h in range(H):
    if B != 0:
        if cnt[w] >= B:
            w += A
    for i in range(A):
        grid[h][w+i] = 1
        cnt[w+i] += 1
for row in grid:
    print(*row, sep='')


### FIXED CODE ###

H, W, A, B = map(int, input().split())
for i in range(B):
    print('1' * A + '0' * (W - A))
for i in range(H - B):
    print('0' * A + '1' * (W - A))
N = int(input())
D = list(map(int, input().split()))

if D[0] != 0:
    print(0)
    exit(0)

waru = 998244353

dic = {}
dic2 = {}

for i in range(1, N+1):
    dic[i] = D[i-1]

for number, distance in dic.items():
    if distance in dic2:
        dic2[distance] = dic2[distance] + 1
    else:
        dic2[distance] = 1

if 0 in dic2:
    if dic2[0] >= 2:
        print(0)
        exit(0)

l = []

for i in range(1, len(dic2.items()) -1):
    l.append(dic2[i] ** dic2[i+1])

r = 1
for x in l:
    r = r * x

if r < waru:
    print(r)
else:
    #d, m = divmod(r, waru)
    print(r)

### FIXED CODE ###

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

if D[0] != 0:
    print(0)
    exit(0)

waru = 998244353

dic = {}
dic2 = {}

for i in range(1, N+1):
    dic[i] = D[i-1]

for number, distance in dic.items():
    if distance in dic2:
        dic2[distance] = dic2[distance] + 1
    else:
        dic2[distance] = 1

if 0 in dic2:
    if dic2[0] >= 2:
        print(0)
        exit(0)

l = []

for i in range(1, len(dic2.items()) - 1):
    if i in dic2 and (i+1) in dic2:
        l.append(dic2[i] ** dic2[i+1])
    else:
        print(0)
        exit(0)

r = 1
for x in l:
    r *= x

d, m = divmod(r, waru)
print(m)
a = input()
b = input()
c = int(a) * int(b)
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')

### FIXED CODE ###

x = input().split()
a = x[0]
b = x[1]
c = int(a) * int(b)
d = c % 2
if d == 0:
  print('Even')
else:
  print('Odd')
n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(n-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n:
                m,n = n,m%n
        return m

ans=a[0]
for j in a:
        if j%ans != 0:
                ans = gcd(j,ans)
print(ans)

### FIXED CODE ###

n,X = map(int,input().split())
x = list(map(int,input().split()))
x.append(X)
x.sort()
a=[]
for i in range(len(x)-1):
        a.append(x[i+1]-x[i])        

def gcd(m,n):
        while n:
                m,n = n,m%n
        return m

ans=a[0]
for j in a:
        if j%ans != 0:
                ans = gcd(j,ans)
print(ans)
from math import fractions


N, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

last = x[0]
ans = abs(x[0] - x[1])
for i in x[1:]:
    ans = gcd(ans, abs(last - i))
    last = i

print(ans)


### FIXED CODE ###

from fractions import gcd


N, X = map(int, input().split())
x = list(map(int, input().split()))

x.append(X)
x.sort()

last = x[0]
ans = abs(x[0] - x[1])
for i in x[1:]:
    ans = gcd(ans, abs(last - i))
    last = i

print(ans)
a = input()
b = input()
if a == "H" and b == "H":
  print("H")
elif a == "H" and b == "D":
  print("D")
elif a == "D" and b == "H":
  print("D")
else:
  print("H")

### FIXED CODE ###

a, b = input().split()
if a =="H" and b == "H":
  print("H")
elif a == "H" and b == "D":
  print("D")
elif a == "D" and b == "H":
  print("D")
else:
  print("H")
MAX = 10**18
def main():
    N = map(int,input())
    A = list(map(int,input().split(' ')))
    ans = 1
    for a in A:
        if a == 0:
            print(0)
            exit(1)
        ans *= a

    if ans > MAX:
        print(-1)
    else:    
        print(ans)

if __name__ == "__main__":
    main()


### FIXED CODE ###

MAX = 10**18
def main():
    N = map(int,input())
    A = list(map(int,input().split(' ')))
    ans = 1
    if 0 in A:
        print(0)
        exit(0)
    for a in A:
        ans *= a
        if ans > MAX:
            print(-1)
            exit(0)

    print(ans)

if __name__ == "__main__":
    main()
a,b = map(int,input().split())
if a<b:
  min = a
  max = b
else:
  min = b
  max = a
c =[min for i in range(max)]
l = "".join(c)
print(l)

### FIXED CODE ###

a,b = map(int,input().split())
if a<b:
  min = a
  max = b
else:
  min = b
  max = a
c =[min for i in range(max)]
d = map(str,c)
l = "".join(d)
print(l)
def Ways(a,b,c):
    if c>=a and c<=b:
        return 'Yes'
    else:
        return 'No'

a,b,c = map(int, input().split())
print(Ways(a,b,c)))

### FIXED CODE ###

def Ways(a,b,c):
    if c>=min(a,b) and c<=max(a,b):
        return 'Yes'
    else:
        return 'No'

a,b,c = map(int, input().split())
print(Ways(a,b,c))
# 累積和

N, M = map(int, input().split())
S = list(map(int, input().split()))
T = list(map(int, input().split()))

dp = [1] * (M+1)
dpleft = [0] * (M)
MOD = 10 ** 9 + 7

for n in range(N):
    ndp = [1]
    for m in range(M):
        if S[n] == T[m]:
            ndp.append(ndp[-1] + dp[m+1])
            dpleft[m] = dp[m+1]
        else:
            ndp.append(ndp[-1] + dpleft[m])
    dp = ndp
print(dp[-1] % MOD)


### FIXED CODE ###

numX, numA = [int(i) for i in input().split()]

if numX < numA:
    print(0)
else:
    print(10)
l = map(int, input().split())
i = 1
list = list(l)

while(1):
	if list[i-1] != 0:
		print ("Case "+str(i)+": "+str(list[i-1]))
		i = i+1
	else:
		break

### FIXED CODE ###

i=0
while(1):
	a = int(input())
	if a == 0:
		break
	print ("Case "+str(i+1)+": "+str(a))
	i = i+1
X,Y,Z =input().split()

U=(X-Y)/(Y+Z)

print(math.floor(U))

### FIXED CODE ###

X,Y,Z=map(int,input().split())
for i in range(50001):
    if Y*i+(i+1)*Z>X:
        print(i-1)
        break
n = int(input())
g = [[-1 for j in range(n)] for i in range(n)]

for i in range(n):
    for _ in range(int(input())):
        x,y = map(int,input().split())
        q[i][x-1] = y

ans = 0
for s in range(2**n):
    ok = True
    for i in range(n):
        if (s>>i&1) == 1:
            for j in range(n):
                if g[i][j] == -1:continue
                if (s>>j&1) != g[i][j]:ok = False
    if ok:
        t = str(bin(x)).count("1")
        ans = max(ans,t)
print(ans)

### FIXED CODE ###

n = int(input())
 
g = [[-1 for j in range(n)] for i in range(n)]
 
for i in range(n):
	a = int(input())
	for _ in range(a):
		x, y = map(int, input().split())
		g[i][x-1] = y
 
ans = 0
for s in range(2**n):
    ok = True
    for i in range(n):
        if (s>>i&1) == 1:
            for j in range(n):
                if g[i][j] == -1: continue
                if (s>>j&1) != g[i][j]: ok = False
    if ok:#あっているなら、ビット内に何個1があるかを数える
        #print("s = ", s)
        t = 0
        x = s#xを変えてもsは変化しない
        t = str(bin(x)).count("1")
        ans = max(ans, t)
print(ans)
import math


hp, length = [int(v) for v in input().split(' ')]
damages = sorted([int(d) for d in input().split(' ')])


if damages[-1] + damages[-2] >= hp:
    print('yes')
else:
    print('no')

### FIXED CODE ###

import sys
 
 
hp, length = [int(v) for v in input().split(' ')]
damages = sorted([int(d) for d in input().split(' ')])
 
 
for d in reversed(damages):
    hp -= d
    if hp <= 0:
        print('Yes')
        sys.exit(0)

print('No')
n = int(input())
a = list(map(int, input().split()))

dict_diffs = dict()
for i in range(1, n+1):
  dict_diffs[i+a[i-1]] = dict_diffs1.get(i+a[i-1], 0) + 1
total = 0
for j in range(1, n+1):
  total += dict_diffs1.get(j-a[j-1], 0)
print(total)

### FIXED CODE ###

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

dict_diffs1 = dict()
dict_diffs2 = dict()
for i in range(1, n+1):
  dict_diffs1[i+a[i-1]] = dict_diffs1.get(i+a[i-1], 0) + 1
  dict_diffs2[i-a[i-1]] = dict_diffs2.get(i-a[i-1], 0) + 1
total = 0
for j in range(1, n+1):
  total += dict_diffs1.get(j-a[j-1], 0)
  total += dict_diffs2.get(j+a[j-1], 0)
total = total//2
print(total)
import sys
N = input()
h = map(int,input().split())
h = list(h)

dp = [sys.maxsize]*N
dp[0]=0

for i in range(int(N)):
    for j in range(i+1,i+2+1):
        if j<int(N) :
            dp[j]=min(dp[j],dp[i]+abs(h[i]-h[j]))

print(dp[int(N)-1])

### FIXED CODE ###

import sys
n =int(input())
h = map(int,input().split())
h = list(h)

dp = [sys.maxsize]*n
dp[0]=0

for i in range(n):
    for j in range(i+1,i+2+1):
        if j<n :
            dp[j]=min(dp[j],dp[i]+abs(h[i]-h[j]))

print(dp[n-1])
long = int(input())
short = int(input())
hour = int(input())
mini = int(input())
longx = long * math.sin( hour / 6 * math.pi )
longy = long * math.cos( mini / 30 * math.pi )
shortx = short * math.sin( hour / 6 * math.pi )
shorty = short * math.cos( mini / 30 * math.pi )
c = math.sqrt((shortx - longx) ** 2 + (shorty - longy) ** 2 )
print(c)

### FIXED CODE ###

short , long , hour1 , mini = map(int, input().split())
hour2 = hour1 + mini / 60
import math
shortx = short * math.sin(math.radians( hour2 * 30 ))
shorty = short * math.cos(math.radians( hour2 * 30 ))
longx = long * math.sin(math.radians( mini * 6 ))
longy = long * math.cos(math.radians( mini * 6 ))
c = math.sqrt((shortx - longx) ** 2 + (shorty - longy) ** 2 )
print(c)
from collections import defaultdict


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    adj_nodes = defaultdict(list)
    for _ in range(N - 1):
        x, y = list(map(int, input().split(' ')))
        x -= 1
        y -= 1
        adj_nodes[x].append(y)
        adj_nodes[y].append(x)
    dp_b = [0 for _ in range(N)]
    dp_w = [0 for _ in range(N)]

    def bfs(node, parent):
        black = 1
        white = 1
        for child in adj_nodes[node]:
            if child == parent:
                continue
            bfs(child, node)
            black *= dp_w[child]
            white *= dp_b[child] + dp_w[child]
            black %= MOD
            white %= MOD
        dp_b[node] = black
        dp_w[node] = white

    bfs(0, None)
    print(dp_b[0] + dp_w[0])


if __name__ == '__main__':
    main()

### FIXED CODE ###

import sys
from collections import defaultdict


sys.setrecursionlimit(10 ** 6)


def main():
    MOD = 10 ** 9 + 7
    N = int(input())
    adj_nodes = defaultdict(list)
    for _ in range(N - 1):
        x, y = list(map(int, input().split(' ')))
        x -= 1
        y -= 1
        adj_nodes[x].append(y)
        adj_nodes[y].append(x)
    dp_b = [0 for _ in range(N)]
    dp_w = [0 for _ in range(N)]

    def bfs(node, parent):
        black = 1
        white = 1
        for child in adj_nodes[node]:
            if child == parent:
                continue
            bfs(child, node)
            black *= dp_w[child]
            white *= dp_b[child] + dp_w[child]
            black %= MOD
            white %= MOD
        dp_b[node] = black
        dp_w[node] = white

    bfs(0, None)
    print((dp_b[0] + dp_w[0]) % MOD)


if __name__ == '__main__':
    main()
#!/usr/bin/env python3
# -*- coding:utf-8 -*-


if __name__=='__main__':
  N, K = map(int, input().split())
  sushis = sorted([list(map(int, input().split())) for _ in range(N)], key=lambda x:x[1], reverse=True)

  curr = sushis[:K]
  leave = sushis[K:]
  base = lambda li: sum([l[1] for l in li])
  types_max = len(set([c[0] for c in sushis]))
  types = set()
  dups = []

  for c in curr:
    if c[0] in types:
      dups += [c]
    else:
      types = types.union({c[0]})

  ps = base(curr) + len(types)**2
  di = {}
  di[len(types)] = ps
  n_types = len(types) + 1
  for i, l in enumerate(leave):
    if i > types_max:
      break
    if not l[0] in types:
      dup = dups.pop()
      di[n_types] = ps - dup[1] + l[1] + n_types**2 - (n_types-1)**2
      ps = di[n_types]
      n_types += 1

  print(sorted(di.items(), key=lambda x:x[1])[-1][1])

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding:utf-8 -*-

import sys
input = sys.stdin.readline

def main():
  N, K = map(int, input().split())
  sushis = [tuple(map(int, input().split())) for _ in range(N)]
  sushis.sort(key=lambda x:x[1], reverse=True)
  curr = sushis[:K]
  leave = sushis[K:]
  base = lambda li: sum([l[1] for l in li])
  types_max = len(set([c[0] for c in sushis]))
  types = set()
  dups = []

  for c in curr:
    if c[0] in types:
      dups += [c]
    else:
      types.add(c[0])
  types = set(types)

  ps = base(curr) + len(types)**2
  di = {}
  di[len(types)] = ps
  n_types = len(types) + 1
  for l in leave:
    if len(types) >= types_max:
      break
    if len(dups) == 0:
      break
    if not l[0] in types:
      dup = dups.pop()
      di[n_types] = ps - dup[1] + l[1] + n_types**2 - (n_types-1)**2
      ps = di[n_types]
      n_types += 1
      types.add(l[0])

  print(sorted(di.items(), key=lambda x:x[1])[-1][1])


if __name__=='__main__':
  main()
import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0 for _ in range(N - 1)]

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]


### FIXED CODE ###

import numpy as np

N, X, Y = map(int, input().split())
X -= 1
Y -= 1

ans = [0] * (N-1)

for i in range(N - 1):
    for j in range(i + 1, N):
        d1 = abs(j - i)
        d2 = abs(X - i) + 1 + abs(j - Y)
        ans[min(d1, d2) - 1] += 1

[print(ans[i]) for i in range(N - 1)]
Thank you for your comment.
When I run the above code, it just displays the text "Loading...." and doesn't jump to the "login" or "home" page.
I'm not sure which part of the code is the cause, but I'm wondering if initState wasn't called

### FIXED CODE ###

import math
N,D = map(int,input().split())
X = []
c = 0
s = 0
for i in range(N):
    X.append(list(map(int,input().split()))) 
for l in range(N):
    # print(str(l) + "l")
    if l == N - 1:
        break
    for i in range(l+1,N):
        for j in range(D):
            s += abs(X[l][j] - X[i][j]) ** 2
        s = math.sqrt(s)
        if s % 1 == 0:
            c += 1
        # print(str(i) + "i")
        s = 0

print(c)
import itertools
import bisect



n = int(input())

sm = [0 for _ in range(20)]

for i in range(1,20):
    sm[i] = int(26*(26**i - 1)/25)

#print(sm[4])

xx = bisect.bisect_left(sm, n)
#print(xx)

rd = n - sm[xx-1]
#print(rd)


al = [0 for _ in range(26)]

for i in range(97,122):
    al[i-97] = chr(i)
    

#rdの字の個数だけループを回して、文字を特定していく

ans = []
tmp = [0 for _ in range(30)]
for i in range(xx):
    unt = 26**(xx-i-1)
    tmp = [j*unt for j in range(30)]
    num = bisect.bisect_left(tmp,rd)
    ans.append(al[num-1])
    rd -= tmp[num-1]
    #print(rd)

print("".join(ans))
    
    

### FIXED CODE ###

import itertools
import bisect



n = int(input())
al = [0 for _ in range(26)]
for i in range(97,123):
    al[i-97] = chr(i)
#print(al)

sm = [0 for _ in range(20)]
for i in range(1,20):
    sm[i] = int(26*(26**i - 1)/25)

#print(sm[4])

xx = bisect.bisect_left(sm, n)
#print(xx)
if(xx > 1):
    rd = n - sm[xx-1]
    ans = []
    tmp = [0 for _ in range(30)]
    for i in range(xx):
        if(xx > 1):
            unt = 26**(xx-i-1)
        if(rd >= unt):
            tmp = [j*unt for j in range(30)]
            num = bisect.bisect_left(tmp,rd)
            ans.append(al[num-1])
            rd -= tmp[num-1]
            #print(rd)
        else:
            ans.append("a")

    print("".join(ans))

else:
    print(al[n-1])
import sys


def count(i, r):
    counter[i] += counter[r] if r >= 0 else 0
    for e in es[i]:
        count(e, i)


if __name__ == "__main__":
    sys.setrecursionlimit(2*(10**5))
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
    counter = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        counter[p-1] += x
    count(0, -1)
    print(*counter)


### FIXED CODE ###

import sys


def count(i, r, value):
    value += rc[i]
    counter[i] = value
    for e in es[i]:
        if e != r:
            count(e, i, value)


if __name__ == "__main__":
    sys.setrecursionlimit(10**6)
    input = sys.stdin.readline
    N, Q = map(int, input().split())
    es = [[] for _ in range(N)]
    for _ in range(N-1):
        a, b = map(int, input().split())
        es[a-1].append(b-1)
        es[b-1].append(a-1)
    counter = [0]*N
    rc = [0]*N
    for _ in range(Q):
        p, x = map(int, input().split())
        rc[p-1] += x
    count(0, -1, 0)
    print(*counter)
import math
H = int(input())
A = int(input())
print(math.ceil(H/A))

### FIXED CODE ###

import math

H, A = [int(x) for x in input().split()]
print(math.ceil(H/A))
import numpy as np
 
N = int(input())
H = np.array(list(map(int, input().split())))
if all(np.diff(H) >= 0):
  print("Yes")
  
for i in range(N):
  h = H.copy()
  h[i] = h[i] - 1
  if all(np.diff(h) >= 0):
    print("Yes")
 
print("No")

### FIXED CODE ###

import numpy as np
N = int(input())
H = list(map(int, input().split()))

max = 0
for i in range(N):
  if max < H[i]:
    max = H[i]
  if max - H[i] >= 2:
    print("No")
    exit(0)
print("Yes")
(h, w) = map(int, input().split(" "))

a=[]
for i in range(h):
        a.append(input().split(" "))

print("#" * (w+2))

for i in range(h):
    print("#", end="")
    for j in range(w):
        print(aline[i][j], end="")
    print("#")

print("#" * (w+2))



### FIXED CODE ###

(h, w) = map(int, input().split(" "))

a=[]
for i in range(h):
        a.append(input())

print("#" * (w+2))

for i in range(h):
    print("#"+a[i]+"#")

print("#" * (w+2))