Harryxun/stf_run huggingface dataset:
n, m = (int(x) for x in input().split())
num_point = [int(x) for x in input().split()]
count = 0

for n in num_point:
    if n > (sum(num_point) / (4 * m)):
        count += 1

if count < m:
    print("No")
else:
    print("Yes")


### FIXED CODE ###

n, m = (int(x) for x in input().split())

a = n % m
b = n / m
if abs(a-m) > a:
    print(a)
else:
    print(abs(a-m))
n = [int(x) for x in input()]
op_cnt = len(n) - 1
for i in range(2 ** op_cnt):
    op = ["-"] * op_cnt
    for j in range(op_cnt):
        if((i >> j) & 1):
            op[op_cnt - 1 - j] = "+"

    formula=""
    for p_n, p_o in zip(n, op + [""]):
        formula += (p_n + p_o)

    if eval(formula)==7:
        print(formula+"=7")
        break

### FIXED CODE ###

def dfs(i, Str, res):
    if i==3:
        if res==7:
            print(Str+"=7")
            exit()
        return
    
    dfs(i+1,Str+"+"+s[i+1],res+int(s[i+1]))
    dfs(i+1,Str+"-"+s[i+1],res-int(s[i+1]))

s=input()
dfs(0,s[0],int(s[0]))
import sys
import heapq
input = sys.stdin.readline
N, M = map(int, input().split())
a = list(map(int, input().split()))
res = 0
if M == 0:
  if N == 1:
    print(0)
  elif N == 2:
    print(sum(a))
  else: print("Impossible")
  exit(0)
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1] * (n + 1)
    self.rnk = [0] * (n + 1)

  def Find_Root(self, x):
    if self.root[x] < 0:
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if x == y:
      return 
    elif self.rnk[x] > self.rnk[y]:
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if self.rnk[x] == self.rnk[y]:
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)

  def Count(self, x):
    return -self.root[self.Find_Root(x)]

uf = UnionFind(N - 1)
for _ in range(M):
  u, v = map(int, input().split())
  uf.Unite(u, v)
hs = [[] for _ in range(N + 1)]
for x in range(N):
  y = uf.Find_Root(x)
  heapq.heappush(hs[y], a[x])
#print(hs)
c = 0
t = []
for x in range(N):
  if len(hs[x]):
    c += 1
    res += heapq.heappop(hs[x])
    if len(hs[x]): t.append(heapq.heappop(hs[x]))
t.sort()
#print(c, t, hs, res)

for i in range(c - 2):
  if i >= c - 2:
    print("Impossible")
    exit(0)
  res += t[i]
print(res)

### FIXED CODE ###

import sys
input = sys.stdin.readline
N, M = map(int, input().split())
a = list(map(int, input().split()))
if N == 1:
  print(0)
  exit(0)
if M == 0 and (N > 2):
  print("Impossible")
  exit(0)
class UnionFind():
  def __init__(self, n):
    self.n = n
    self.root = [-1] * (n + 1)
    self.rnk = [0] * (n + 1)

  def Find_Root(self, x):
    if self.root[x] < 0:
      return x
    else:
      self.root[x] = self.Find_Root(self.root[x])
      return self.root[x]

  def Unite(self, x, y):
    x = self.Find_Root(x)
    y = self.Find_Root(y)
    if x == y:
      return 
    elif self.rnk[x] > self.rnk[y]:
      self.root[x] += self.root[y]
      self.root[y] = x
    else:
      self.root[y] += self.root[x]
      self.root[x] = y
      if self.rnk[x] == self.rnk[y]:
        self.rnk[y] += 1

  def isSameGroup(self, x, y):
    return self.Find_Root(x) == self.Find_Root(y)

  def Count(self, x):
    return -self.root[self.Find_Root(x)]
uf = UnionFind(N)
d = [[] for _ in range(N)]
for _ in range(M):
  u, v = map(int, input().split())
  uf.Unite(u, v)
for i in range(N):
  d[uf.Find_Root(i)].append(a[i])
res = 0
x = []
y = 0
for i in range(N):
  d[i].sort(reverse = True)
  if len(d[i]):
    res += d[i].pop()
    y += 1
  x += d[i]
if y == 1:
  print(0)
  exit(0)
x.sort()
for i in range((y - 1) * 2 - y):
  if i >= len(x):
    print("Impossible")
    exit(0)
  res += x[i]
print(res)
li = list(map(int(input().split()))
if li[0] % 2 == 0 or li[1] & 2 == 0:
    print("Evem")
else:
    print("Odd")
    

### FIXED CODE ###

a = list(map(int, input().split()))
if a[0] % 2 == 0 or a[1] % 2 == 0:
	print("Even")
else:
	print("Odd")
a

### FIXED CODE ###

import sys
sys.setrecursionlimit(10**6) #再帰関数の上限
import math
from copy import copy, deepcopy
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque 
#deque(l), pop(), append(x), popleft(), appendleft(x)
##listでqueの代用をするとO(N)の計算量がかかってしまうので注意
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
#import fractions#古いatcoderコンテストの場合GCDなどはここからimportする


def input(): return sys.stdin.readline()[:-1]
def printl(li): print(*li, sep="\n")
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)

def main():
    mod = 10**9+7
    #w.sort(key=itemgetter(1),reversed=True)  #二個目の要素で降順並び替え

    N = input()
    #N, K = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    #S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列
    s=N[-1]
    l1=("2","4","5","7","9")
    l2=("0","1","6","8")
    if s in l1:
        print('hon')
    elif s in l2: print('pon')
    else: print("bon")






if __name__ == "__main__":
    main()
a, b, c, d, e, f = map(int, input().split())
x = set()
y = set()
for A in range(0, f + 1, 100 * a):
    for B in range(0, f + 1, 100 * b):
        if A + B > f:
            break
        if A + B:
            x.add(A + B)
for C in range(0, f + 1, c):
    for D in range(0, f + 1, d):
        if C + D > f:
            break
        y.add(C + D)
ans = 0
for X in x:
    for Y in y:
        if X + Y <= f and 100 * Y / X <= e:
                if ans < Y / (X + Y):
                    ans = Y / (X + Y)
                    w = X
                    s = Y
print(w + s, s)

### FIXED CODE ###

a, b, c, d, e, f = map(int, input().split())
x = set()
y = set()
for A in range(0, f + 1, 100 * a):
    for B in range(0, f + 1, 100 * b):
        if A + B > f:
            break
        if A + B:
            x.add(A + B)
for C in range(0, f + 1, c):
    for D in range(0, f + 1, d):
        if C + D > f:
            break
        y.add(C + D)
ans = 0
w = 100 * a
s = 0
for X in x:
    for Y in y:
        if X + Y <= f and 100 * Y / X <= e:
                if ans < Y / (X + Y):
                    ans = Y / (X + Y)
                    w = X
                    s = Y
print(w + s, s)
MAX = 100
INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2
d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
color = [WHITE for i in range(n)]
d[0] = 0

n = int(input())
M = [[map(int, input().split()) for i in range(n)] for j in range(n)]
for i in range(n):
    for j in range(n):
        if (M[i][j] == -1):
            M[i][j] = INFTY

def prim():
    global M, d, p, color
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == 1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > M[u][v]):
                    d[v] = M[u][v]
                    p[v] = u
                    color[v] = GRAY
    
    _sum([M[i][p[i]] for i in range(n) if (p[i] != -1)])

print(prim())

### FIXED CODE ###

INFTY = 1 << 21
WHITE = 0
GRAY = 1
BLACK = 2

n = int(input())
M = [list(map(int, input().split())) for i in range(n)]

d = [INFTY for i in range(n)]
p = [-1 for i in range(n)]
color = [WHITE for i in range(n)]

for i in range(n):
    for j in range(n):
        if (M[i][j] == -1):
            M[i][j] = INFTY

def prim():
    global M, d, p, color
    d[0] = 0
    while(1):
        minv = INFTY
        u = -1
        for i in range(n):
            if (minv > d[i] and color[i] != BLACK):
                u = i
                minv = d[i]
        if (u == -1):
            break
        color[u] = BLACK
        for v in range(n):
            if (color[v] != BLACK and M[u][v] != INFTY):
                if (d[v] > M[u][v]):
                    d[v] = M[u][v]
                    p[v] = u
                    color[v] = GRAY
    
    return sum([M[i][p[i]] for i in range(n) if p[i] != -1])

print(prim())
n = input()

if (n[-1].in(2,4,5,7,9)):
  print('pon')
elif (n[-1].in(0,1,6,8)):
  print('hon')
elif (n[-1] == 3):
  pirint('bon')

### FIXED CODE ###

n = int(input())
a = n%10

if a in [2,4,5,7,9]:
    print("hon")
elif a in [0, 1, 6, 8]:
    print("pon")
else:
    print("bon")
from itertools import accumulate

n, m = map(int, input().split())
a = list(map(int, input().split()))
MAX = 10 ** 5

scores = [0] * (MAX + 1)
for e in a:
    scores[e] += 1

acc = list(accumulate(scores))


def f(x):
    cnt = 0
    for e in a:
        cnt += n - acc[max(0, x - e - 1)]

    return cnt


l = 0
r = 2 * MAX
while r - l > 1:
    mid = (l + r) // 2
    if f(mid) >= m:
        l = mid
    else:
        r = mid

scores_sum = [i * e for i, e in enumerate(scores)]
acc_sum = list(accumulate(scores_sum))
sm = sum(a)
ans = 0
cnt_sum = 0
for e in sorted(a, reverse=True):
    i = max(0, l - e - 1)
    cnt = n - acc[i]
    ans += e * cnt + sm - acc_sum[i]
    cnt_sum += cnt

ans -= (cnt_sum - m) * l

print(ans)


### FIXED CODE ###

from itertools import accumulate

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

a.sort(reverse=True)
a_acm = list(accumulate(a))

a_cnt = [0] * (10 ** 6 + 1)
for e in a:
    a_cnt[e] += 1

acm = list(accumulate(a_cnt))


def count_handshake(x):
    ret = 0
    for e in a:
        if x - e - 1 >= 0:
            cnt = acm[-1] - acm[x-e-1]
        else:
            cnt = n

        ret += cnt

    return ret


left = 0
right = 10 ** 6

while right - left > 1:
    mid = (left + right) // 2
    if count_handshake(mid) >= m:
        left = mid
    else:
        right = mid

ans = 0
handshake_cnt = 0
for e in a:
    if left - e - 1 >= 0:
        cnt = n - acm[left-e-1]
    else:
        cnt = n

    if cnt > 0:
        ans += e * cnt + a_acm[cnt-1]
        handshake_cnt += cnt

if handshake_cnt > m:
    ans -= left * (handshake_cnt - m)

print(ans)
from math import *
r = int(input())
print("{:.6f} {:.6f}".format(r * r * pi, 2 * r * pi))



### FIXED CODE ###

r = float(input())
print("{:.6f} {:.6f}".format(r * r * 3.14159265359, 2 * r * 3.14159265359))
n,a,b = map(int, input().split())
ans = 0

for i in range(n+1):
    if a <= sum(list(str(i))) <= b:
            ans += i
print(ans)


### FIXED CODE ###

n, a, b = map(int, input().split())
ans = 0
for i in range(n+1):
    if a <= sum(list(map(int, list(str(i))))) <= b:
        ans += i
print(ans)
def rem(x,r):
  if (x,r) == (1,0):
    return [[1]]
  if x <= 2*r:
    return -1
  ret = []
  for i in range(1,x+1):
    if x%i == r:
      ret.append([i])
    else:
      s = rem(x%i,r)
      if s == -1:
        continue
      else:
        for j in s:
          if j == -1:
            continue
          elif j[-1] < i:
            ret.append([i]+j)
          else:
            ret.append([i]+j)
  return ret
n = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
for xx,yy in zip(x,y):
  if xx != yy and rem(xx,yy) == -1:
    print(-1)
    exit()
ls = [rem(xx,yy) if xx != yy else 0 for xx,yy in zip(x,y)]
flg = [0]*n
def findmx(lsi,ansst,mx):
  ret = 100
  if lsi == 0:
    return 0
  for lsls in lsi:
    for j in lsls:
      if j > mx:
        return min(j,ret)
      elif j in ansst:
        continue
      else:
        ret = min(j,ret)
        break
    else:
      return 0
  else:
    return 0
mxls = [ls[i][0][0] if type(ls[i]) == list else 0 for i in range(n)]
mx = max(mxls)
ansst = set((mx,))
mxcand = mx
while mxcand:
  for i in range(n):
    t = findmx(ls[i],ansst,mx)
    mxls[i] = t
    if t == 0:
      flg[i] = 1
  mxcand = max(mxls)
  ansst.add(mxcand)
  if flg.count(1) == n:
    break
ans = 0
for b in ansst:
  if b:
    ans += 2**b
print(ans)

### FIXED CODE ###

from bisect import bisect
s=input()
n=len(s)
ls=[0]*26
if s == "zyxwvutsrqponmlkjihgfedcba":
  print(-1)
  exit()
if n<26:
  for i in range(n):
    ls[ord(s[i])-97]=i+1
  for i in range(26):
    if ls[i]==0:
      x=i
      break
  print(s+chr(x+97))
else:
  for i in range(n):
    ls[i] = ord(s[i])-97
  if ls[25]>ls[24]:
    print(s[:24]+s[25])
  else:
    tmp = []
    for i in range(24,-1,-1):
      tmp.append(ls[i+1])
      if ls[i+1]>ls[i]:
        tmps = sorted(tmp)
        x = bisect(tmps,ls[i])
        print(s[:i]+chr(tmps[x]+97))
        break
s=list(input())
t=list(input())
count=0
for i im range(3):
  if s[i]==t[i]:
    count+=1
print(count)    

### FIXED CODE ###

s=list(input())
t=list(input())
count=0
for i in range(3):
  if s[i]==t[i]:
    count+=1
print(count)
#!/usr/bin/env python3
import math

a, b = map(int, input().split())
x = math.floor((a-1)/0.08)
y = math.floor((a+1)/0.08)
z = math.floor((b-1)/0.1)
w = math.floor((b+1)/0.1)

if y<z:
    print(-1)
    exit(0)

ans = []
for i in range(min(x,z), min(y,w)):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans.append(i)

if len(ans) == 0:
    print(-1):
else:
    print(min(ans))


### FIXED CODE ###

#!/usr/bin/env python3
import math

a, b = map(int, input().split())
x = math.floor((a-1)/0.08)
y = math.floor((a+1)/0.08)
z = math.floor((b-1)/0.1)
w = math.floor((b+1)/0.1)

if y<z:
    print(-1)
    exit(0)

ans = []
for i in range(min(x,z), min(y,w)):
    if math.floor(i*0.08) == a and math.floor(i*0.1) == b:
        ans.append(i)

if len(ans) == 0:
    print(-1)
else:
    print(min(ans))
import sys
input = sys.stdin.readline
n, t = map(int, input().split())
shop = []
shop_0 = []
for i in range(n):
    a, b = map(int, input().split())
    if a == 0:
        shop_0.append((a, b))
        n -= 1
    else:
        shop.append((a, b))
shop.sort(key = lambda x: (x[0])/(1+x[1]), reverse = True)
shop0.sort(key = lambda x: x[1])

inf = 10**18
dp = [[inf for i in range(30)] for j in range(n+1)]
dp[0][0] = 0
for i in range(n):
    for j in range(29):
        dp[i+1][j] = min(dp[i][j], dp[i+1][j])
        dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + dp[i][j]*(shop[i][0])+shop[i][1]+1)



ans = 0
for i in range(30):
    tmp = i
    T = dp[n][i]
    if T > t:
        continue
    else:
        for j in range(len(shop_0)):
            if T+shop_0[j][1]+1 <= t:
                T += shop_0[j][1]+1
                tmp += 1
            else:
                break
    ans = max(tmp, ans)

print(ans)


### FIXED CODE ###

import sys
input = sys.stdin.readline
n, t = map(int, input().split())
shop = []
shop_0 = []
for i in range(n):
    a, b = map(int, input().split())
    if a == 0:
        shop_0.append((a, b))
        n -= 1
    else:
        shop.append((a, b))
shop.sort(key = lambda x: (x[0])/(1+x[1]), reverse = True)
shop_0.sort()

inf = 10**18
dp = [[inf for i in range(30)] for j in range(n+1)]
dp[0][0] = 0
for i in range(n):
    for j in range(29):
        dp[i+1][j] = min(dp[i][j], dp[i+1][j])
        dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + (dp[i][j]+1)*(shop[i][0])+shop[i][1]+1)



ans = 0
for i in range(30):
    tmp = i
    T = dp[n][i]
    if T > t:
        continue
    else:
        for j in range(len(shop_0)):
            if T+shop_0[j][1]+1 <= t:
                T += shop_0[j][1]+1
                tmp += 1
            else:
                break
    ans = max(tmp, ans)

print(ans)
N = int(input())
A = list(map(int, input().split()))
sum_ = 0
for i in range(N):
    for j in range(i, N):
        sum_ += A[i] * A[j]
        sum_ %= 1_000_000_007

print(sum_)


### FIXED CODE ###

D, T, S = map(int, input().split())
print('No' if (D / T) > S else 'Yes')
a,b,c=map(int,input().split())
if	a*b*c==5*5*7
	print("YES")
else
	print("NO")

### FIXED CODE ###

a,b,c=map(int,input().split())
if	a*b*c==5*5*7:
	print("YES")
else:
	print("NO")
a = int(input())
b = int(input())
c = int(input())
d = a + b + c
if (d >= 22):
    print('bust')
else:
    print('win')

### FIXED CODE ###

a,b,c = map(int, input().split())
d = a + b + c
if d >= 22:
    print('bust')
else:
    print('win')
X, Y, Z, K = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
l = []

for i in range(X):
    for j in range(Y):
        l.append(a[i] + b[j])
l.sort(reverse = True)
l = l[:K]

L = []
c.sort(reverse = True)

for i in range(len(l)):
    for j in range(min(Z, K)):
        L.append(l[i] + c[j])

L.sort(reverse = True)
print(*L[:K], sep = "\n")


### FIXED CODE ###

a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())
if b - a > k or  c - a > k or  d - a > k or  e - a > k or  c - b > k or  d - b > k or  e - b > k or  d - c > k or  e - c > k or  e - d > k:
    print(":(")
else:
    print("Yay!")
K=int(input())
N=min(50,K)
a = list(range(N))

m = int(K / len(a))
b = K%len(a)
a=list(map(lambda x: x + m, a))
for i in range(b):
    a[i] += N
    for j in range(N):
        if j == i:
            continue
        a[j] -= 1
print(N)
print(' '.join(list(map(str,a))))


### FIXED CODE ###

K=int(input())
N=50
a = list(range(N))
m = K // N
b = K % N
a=list(map(lambda x: x + m, a))
for i in range(b):
    a[i] += N
    for j in range(N):
        if j != i:
            a[j] -= 1
print(N)
print(' '.join(map(str,a)))
import numpy as np

n,m=map(int,input().split())
e = []

for _ in range(1,m+1):
    a,b=map(int,input().split())
    e.append((a,b))

q = int(input())
cs = [0] * (q+1)
dp = np.zeros((n+1, 11), int)
for i in range(1, q+1):
    v,d,c=map(int,input().split())
    cs[i] = c
    dp[v,d] = i

for d in range(9, -1, -1):
    for i in range(1,n+1):
        dp[i,d] = max(dp[i,d], dp[i,d+1])
    for a,b in e:
        dp[a,d] = max(dp[a,d], dp[b,d+1])
        dp[b,d] = max(dp[b,d], dp[a,d+1])

for i in range(1, n+1):
    print(cs[dp[i,0]])

### FIXED CODE ###

n,m=map(int,input().split())
e = []

for _ in range(1,m+1):
    a,b=map(int,input().split())
    e.append((a,b))

q = int(input())
cs = [0] * (q+1)
dp = [[0]*11 for _ in range(n+1)]
for i in range(1, q+1):
    v,d,c=map(int,input().split())
    cs[i] = c
    dp[v][d] = i

for d in range(9, -1, -1):
    for i in range(1,n+1):
        dp[i][d] = max(dp[i][d], dp[i][d+1])
    for a,b in e:
        dp[a][d] = max(dp[a][d], dp[b][d+1])
        dp[b][d] = max(dp[b][d], dp[a][d+1])

for i in range(1, n+1):
    print(cs[dp[i][0]])
s=input()
n=s

if s==reversed(s) and s[0:(n-1)//2]==reverses(s[0:(n-1)//2]) and s[((n+3)//2)-1:n] and reversed(s[((n+3)//2)-1:n]):
print("Yes")

else:
	print("No")

### FIXED CODE ###

s = input()
n = len(s)
sl = s[:n//2]
sr = s[n//2+1:]
if sl == sr and sr ==  sr[::-1]:
    print('Yes')
else:
    print('No')
#d 
n=int(input())
x=input()

def popcount(m):
    return bin(m).count("1")

intx = int( "0b"+x ,0 )
popcount0 = x.count("1")

intx_mod_pp1 = intx %(popcount0+1)
intx_mod_pm1 = intx %(popcount0-1)


jisho = ["yet"]*n
# pow2ip = .5
# pow2im = .5

for i in range(n):
    pow2ip = pow(2,n-i-1,popcount0+1)
    pow2im = pow(2,n-i-1,popcount0-1)
#     if x[i]=="0":
#         intxi = intx+pow2i
#     else:
#         intxi = intx-pow2i
#     if intxi==0:
#         print(0)
#         continue
    if False:
        pass
    
    
    else:
        intxi=1
        c=0
        while intxi!=0:
            if c==0:
                if x[i]=="0":
                    pop = popcount0+1
                    intxi = (intx_mod_pp1 + pow2ip%pop )%pop
                else:
                    pop = popcount0-1
                    intxi = (intx_mod_pm1 - pow2im%pop )%pop        
            else:
                if jisho[intxi]=="yet":
                    togo = intxi%popcount(intxi)
                    jisho[intxi]= togo
                    intxi = togo
                else:
                    intxi =jisho[intxi]
                
            #print(intxi)
            c+=1
        print(c)
        #print()
    
#        print("f(n)=",c)

### FIXED CODE ###

#d 
n=int(input())
x=input()

def popcount(m):
    return bin(m).count("1")

intx = int( "0b"+x ,0 )
popcount0 = x.count("1")

intx_mod_pp1 = intx %(popcount0+1)
if popcount0!=1:
    intx_mod_pm1 = intx %(popcount0-1)
    

jisho = ["yet"]*n
# pow2ip = .5
# pow2im = .5

for i in range(n):
    if x[i]=="1" and popcount0==1:
        print(0)
        continue
    
    pow2ip = pow(2,n-i-1,popcount0+1)
    if popcount0!=1:
        pow2im = pow(2,n-i-1,popcount0-1)

    if False:
        pass
    
    
    else:
        intxi=1
        c=0
        while intxi!=0:
            if c==0:
                if x[i]=="0":
                    pop = popcount0+1
                    intxi = (intx_mod_pp1 + pow2ip%pop )%pop
                else:
                    pop = popcount0-1
                    intxi = (intx_mod_pm1 - pow2im%pop )%pop        
            else:
                if jisho[intxi]=="yet":
                    togo = intxi%popcount(intxi)
                    jisho[intxi]= togo
                    intxi = togo
                else:
                    intxi =jisho[intxi]
                
            #print(intxi)
            c+=1
        print(c)
        #print()
    
#        print("f(n)=",c)
a,b,c=int(input())
print(a+b+c)

### FIXED CODE ###

a,b,c=input()
a=int(a)
b=int(b)
c=int(c)
print(a+b+c)
input()
lis = list(map(int, input().split()))
print(len([n for i, n in enumerate(lis[1:]) if n >= max(lis[:i + 1])]) + 1

### FIXED CODE ###

input()
lis = list(map(int, input().split()))
print(len([n for i, n in enumerate(lis[1:]) if n >= max(lis[:i + 1])]) + 1)
a = input()
if a % 9 == 0:
  print("Yes")
else:
  print("No")

### FIXED CODE ###

a = int(input())
if a % 9 == 0:
  print("Yes")
else:
  print("No")
n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
ans = 1

for i in range(1,n+2):
    d[i] = d[i-1]+l[i-1]
    if x < d[i]:
        break
    ans += 1

print(ans)

### FIXED CODE ###

n,x = map(int,input().split())
l = list(map(int,input().split()))
d = [0]*(n+1)
ans = 1

for i in range(1,n+1):
    d[i] = d[i-1]+l[i-1]
    if x < d[i]:
        break
    ans += 1

print(ans)
n=int(input())
for i in range(1,n+1):
 ans=0
 for x in range(1,i):
  for y in range(1,i):
   for z in range(1,i):
    if i==x*x+y*y+z*z+x*y+x*z+y*z:
      ans+=1
 print(ans)  

### FIXED CODE ###

l,r,k=map(int,input().split())
ans=0
for i in range(l,r+1):
 if i%k==0:
  ans+=1
 else:
  pass
print(ans)
H, N = map(int, input().split())
A = []
B = []
for i in range(n):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)

dp = [0 for i in range(H+1)]

for i in range(H+1):
	dp[i] = min(B[j]  if h < A[j]  else  dp[i - A[j]] + B[j]  for j in range(n))

print(dp[H])


### FIXED CODE ###

H, n = map(int, input().split())
A = []
B = []
for i in range(n):
	a, b = map(int, input().split())
	A.append(a)
	B.append(b)

dp = [0 for i in range(H+1)]

for i in range(1, H+1):
	dp[i] = min(dp[i - A[j]] + B[j]  if A[j] <= i  else  B[j]  for j in range(n))

print(dp[H])