Harryxun/stf_run huggingface dataset:
n = int(input())
x = input()
a = x.count('1')
b = int(x,2)
# print (b)

ary = [None for i in range(200010)]
ary[0] = 0

def f(n):
  if ary[n] is not None:
    return ary[n]
  b = bin(n).count('1')
  r = 1 + f(n%b)
  ary[n] = r
  return ary[n]


for i in range(200010):
  f(i)

a1 = a + 1
a0 = a - 1

ans = [0 for i in range(n)]
for i, j in enumerate(reversed(list(x))):
  if j == '0':
    x = b + pow(2,i)
    y = x %a1
    ans[i] = ary[y]+1
  else:
    x = b - pow(2,i)
    y = x %a0
    ans[i] = ary[y]+1
ans.reverse()
for i in ans:
  print (i)

### FIXED CODE ###

n = int(input())
x = input()
a = x.count('1')
b = int(x,2)
# print (b)

ary = [None for i in range(200010)]
ary[0] = 0

def f(n):
  if ary[n] is not None:
    return ary[n]
  b = bin(n).count('1')
  r = 1 + f(n%b)
  ary[n] = r
  return ary[n]


a1 = a + 1
a0 = a - 1
for i in range(200010):
  f(i)


one = [1] * 200010
zero = [1] * 200010
for i in range(1, 200010):
    if a0 != 0:
        one[i] = one[i-1] * 2 % a0
    zero[i] = zero[i-1] * 2 % a1


ans = [0 for i in range(n)]
c1 = b%a1
if a0 != 0:
  c0 = b%a0
for i in range(n-1, -1, -1):
  if x[n-1-i] == '0':
    y = c1 + zero[i]
    # y = x %a1
    y %= a1
    print (ary[y]+1)
  else:
    if a0 != 0:
      y = c0 - one[i]
      y %= a0
      print (ary[y]+1)
    else:
      print (0)
# ans.reverse()
# for i in ans:
#   print (i)
input(X)
if (X>40||X<-40):
  return 0
  if(X=>30):
    print(Yes)
  else:
    print(No)


### FIXED CODE ###

x=input()
X=int(x)
if(X>=30 and X<=40):
  print('Yes')
elif(X>=-40 and X<30):
  print('No')
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

h, w = map(int, readline().split())
a = [input() for i in range(h)]
q = []
dist = [[False] * h for _ in range(w)]
for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            q.append((i, j))
            dist[i][j] = True
test = [(0, 1), (0, -1), (1, 0), (-1, 0)]
cnt = -1
while q:
    cnt += 1
    qq = []
    for y, x in q:
        for dy, dx in test:
            yy, xx = y + dy, x + dx
            if xx < 0 or yy < 0 or xx > w - 1 or yy > h - 1 or dist[yy][xx]:
                continue
            else:
                dist[yy][xx] = True
                qq.append((yy, xx))
    q = qq
print(cnt)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

h, w = map(int, readline().split())
a = [input() for i in range(h)]
q = []
dist = [[False] * w for _ in range(h)]
for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            q.append((i, j))
            dist[i][j] = True
test = [(0, 1), (0, -1), (1, 0), (-1, 0)]
cnt = -1
while q:
    cnt += 1
    qq = []
    for y, x in q:
        for dy, dx in test:
            yy, xx = y + dy, x + dx
            if xx < 0 or yy < 0 or xx > w - 1 or yy > h - 1 or dist[yy][xx]:
                continue
            else:
                dist[yy][xx] = True
                qq.append((yy, xx))
    q = qq
print(cnt)
l,r = map(int,input().split())

if r - l >= 2018 :
    print(0)
else:
    ans = 2019
    for i in range(l,r):
        for j in range(l + 1,r + 1)
            ans = min(ans,(i*j)%2019)
    print(ans)


### FIXED CODE ###

l,r = map(int,input().split())

if r - l >= 2018:
    print(0)
else:
    ans = 2019
    for i in range(l,r):
        for j in range(i+1,r+1):
            ans = min(ans,(i*j)%2019)
    print(ans)
import math.pi

r = float(input())

s = math.pi * (r ** 2)

p = 2 * math.pi * r

print(s,p)



### FIXED CODE ###

from math import pi

r = float(input())

s = pi * (r ** 2)

p = 2 * pi * r

print(s,p)
a,b=input()
if(a<b):
    print("a<b")
elif(a>b):
    print("a>b")
else:print("a==b")

### FIXED CODE ###

a,b=map(int,input().split())
if a<b:
    print ("a < b")
elif a>b:
    print ("a > b")
else:
    print ("a == b")
N = int(input())
S = input()
R = [i+1 for i in range(N) if S[i] == 'R']
G = [i+1 for i in range(N) if S[i] == 'G']
B = [i+1 for i in range(N) if S[i] == 'B']

len_r = len(R)
len_g = len(G)
len_b = len(B)

if len_r > len_g and len_r > len_b:
    X = G
    Y = B
    Z = R
elif len_g > len_r and len_g > len_b:
    X = R
    Y = B
    Z = G
elif len_b > len_g and len_b > len_r:
    X = G
    Y = R
    Z = B

ans = 0

for r in X:
    for g in Y:
        tmp = 0
        if r < g:
            a = r
            b = g
        else:
            a = g
            b = r
        i = b-a
        if a-i in Z:
            tmp+=1
        if b+i in Z:
            tmp+=1
        if a+(i/2) == b -(i/2) and a+(i/2) in Z:
            tmp += 1
        ans += len(Z) - tmp
print(ans)

### FIXED CODE ###

n=int(input())
s=input()
c=s.count
a=c('R')*c('G')*c('B')
for i in range(n):
  for j in range(i+2,n,2):
    if s[i]!=s[i+j>>1]!=s[j]!=s[i]:
      a-=1
print(a)
def m():
    n, q = map(int, input().split())
    tree = [[] for _ in range(n + 1)]
    for i in range(1, n):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    counter = [0 for _ in range(n + 1)]
    for _ in range(q):
        p, x = map(int, input().split())
        counter[p] += x

    ans = [0] * (n + 1)
    visited = []

    def dfs(root, point):
        point += counter[root]
        ans[root] = point
        visited.append(root)
        for j in tree[root]:
            if j in visited:
                continue
            dfs(j, point)
        return

    dfs(1, 0)
    for i in range(1, n + 1):
        print(ans[i], '', end='')
    return ans


m()


### FIXED CODE ###

import queue
import sys
def input(): return sys.stdin.readline().rstrip()

def m():
    n, q = map(int, input().split())
    tree = [[] for _ in range(n + 1)]
    for i in range(1, n):
        a, b = map(int, input().split())
        tree[a].append(b)
        tree[b].append(a)
    counter = [0] * (n + 1)
    for _ in range(q):
        p, x = map(int, input().split())
        counter[p] += x

    que = queue.Queue()
    visited = [False] * (n+1)

    def bfs(root, base):
        base += counter[root]
        visited[root] = True
        for e in tree[root]:
            if visited[e]:
                continue
            que.put(e)
            counter[e] += base

        while not que.empty():
            x = que.get()
            point = counter[x]
            visited[x] = True
            for e in tree[x]:
                if visited[e]:
                    continue
                que.put(e)
                counter[e] += point

    bfs(1, 0)
    print(*counter[1:])
    return


m()
t = list(input())
n = len(t)
if n == 1:
  if t == '?':
    t = 'D'
elif n == 2:
  if t == '??':
    t = 'PD'
  else:
    t.replace('?', 'D')
else:
  for i in range(n-1):
    if t[i] != '?':
      continue
    else:
      if i == 0:
        if t[i+1] != 'P':
          t[i] = 'D'
          continue
        else:
          t[i] = 'P'
          continue
      else:
        if t[i-1] == 'D' and t[i+1] != 'P':
          t[i] = 'P'
        else:
          t[i] = 'D'

if t[-1] =='?':
  t[-1] = 'D'

print(''.join(t))



### FIXED CODE ###

t = list(input())
n = len(t)
for i in range(n):
  if t[i] == '?':
    t[i] = 'D'
print(''.join(t))
from math import factorial

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

n1 = v.count(v[a - 1])
n2 = v[:a].count(v[:a][a - 1])

print(sum(v[:a]) / a)
if len(set(v[:a])) != 1:
	print(int(factorial(n1) / (factorial(n2) * factorial(n1 - n2))))
else:
	ans = 0
	for i in range(a, b + 1):
		ans += int(factorial(n1) / (factorial(i) * factorial(n1 - i)))
	print(int(ans))

### FIXED CODE ###

from math import factorial

n, a, b = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

n1 = v.count(v[a - 1])
n2 = v[:a].count(v[:a][a - 1])

print(sum(v[:a]) / a)
if len(set(v[:a])) != 1:
	if n1 == n2:
		print(1)
	else:
		print(int(factorial(n1) / (factorial(n2) * factorial(n1 - n2))))
else:
	ans = 0
	if n1 == 1:
		print(1)
	else:
		for i in range(a, min(n1 + 1, b + 1)):
			ans += int(factorial(n1) / (factorial(i) * factorial(n1 - i)))
		print(int(ans))
import math
while True:
    a, b = map(int,raw_input().split())
    print int(math.log10(a+b) + 1)

### FIXED CODE ###

while True:
	try:
		a,b = map(int,raw_input().split())
		print len(str(a+b))
	except EOFError:
		break
from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]
def gcd(a, b):
    if a < b: return gcd(b, a)
    if b == 0: return a
    return gcd(b, a%b)
def lcm(a, b):
    return a * b // gcd(a, b)

n, m = il()
s = input()
t = input()
ans = lcm(n, m)
hoge = "0" * ans
for i in range(n):
    nn = ans//n
    if hoge[i*nn] != "0" and hoge[i*nn] != s[i]:
        print(-1)
        exit()
    hoge = hoge[:i*nn] + s[i] + hoge[i*nn+1:]
for i in range(m):
    mm = ans//m
    if hoge[i*mm] != "0" and hoge[i*mm] != t[i]:
        print(-1)
        exit()
    hoge = hoge[:i*mm] + t[i] + hoge[i*mm+1:]
print(ans)

### FIXED CODE ###

from sys import stdin
il = lambda func=int: list(map(func, stdin.readline().rstrip().split()))
ils = lambda n, s="int(input())": [eval(s) for _ in range(n)]
def gcd(a, b):
    if a < b: return gcd(b, a)
    if b == 0: return a
    return gcd(b, a%b)
def lcm(a, b):
    return a * b // gcd(a, b)

n, m = il()
s = input()
t = input()
aa = gcd(n, m)
bb = lcm(n, m)
cc = aa // bb
for i in range(aa):
    if s[n//aa*i] != t[m//aa*i]:
        print(-1)
        exit()
print(bb)
s=input()

int a = s*s*s+s*s+s

 return

### FIXED CODE ###

s = int(input())
 
N=s+s*s+s*s*s
 
print (N)
from math import factorial
 
N, M = map(int, input().split())
if N != 0 and M != 0:
  if N==1 and M==1:
    print(0)
  else:
    Ncon = factorial(N) // factorial(2) // factorial(N - 2)
    Mcon = factorial(M) // factorial(2) // factorial(M - 2)
    print(Ncon+Mcon)
if N ==0:
  print(factorial(M) // factorial(2) // factorial(M - 2))
if M == 0:
  print(factorial(N) // factorial(2) // factorial(N - 2))

### FIXED CODE ###

from math import factorial
 
N, M = map(int, input().split())
if N != 0 and M != 0 and N != 1 and M != 1:
  Ncon = factorial(N) // factorial(2) // factorial(N - 2)
  Mcon = factorial(M) // factorial(2) // factorial(M - 2)
  print(Ncon+Mcon)
if N ==0 or N == 1:
  if M!=1:
    print(factorial(M) // factorial(2) // factorial(M - 2))
if M == 0 or M==1:
  if N!=1:
    print(factorial(N) // factorial(2) // factorial(N - 2))
if N==1 and M==1:
  print(0)
import sys

get = sys.stdin.readline()
a, b = get.split(" ")
a2 = long(a)
b2 = long(b)
ans = b2 * (10 ** (a2*2))
print(ans)

### FIXED CODE ###

import sys

get = sys.stdin.readline()
a, b = get.split(" ")
a2 = int(a)
b2 = int(b)
ans = 0
if(b2 == 100):
    ans = (b2+1) * (10 ** (a2*2))
else:
    ans = b2 * (10 ** (a2*2))
print(ans)
n,m = map(int,input().split())
d = {}
cnt = 0
ans = 0
for i in range(n):
    a,b =map(int,input().split())
    d[a] = b
while cnt <m:
    if cnt+d[min(d)] <m:
        ans += min(d)*d[min(d)]
        cnt +=d[min(d)]
        del d[min(d)]
    else:
        ans += min(d)*(m-cnt)
        break
print(ans)

### FIXED CODE ###

n,m = map(int,input().split())
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
cnt = 0
a = sorted(a, key=lambda x:x[0])
for i in range(n):
    if cnt + a[i][1] <m:
        ans += a[i][0]*a[i][1]
        cnt +=a[i][1]
    else:
        ans += a[i][0]*(m-cnt)
        break
print(ans)
N = int(input())
order = [int(x) for x in input().split()]
order_sorted = sorted(range(len(order)), key=lambda k: order[k])
order_sorted = [x+1 for in x order_sorted]
print(*order_sorted)

### FIXED CODE ###

N = int(input())
order = [int(x) for x in input().split()]
order_sorted = sorted(range(len(order)), key=lambda k: order[k])
order_sorted = [x+1 for x in order_sorted]
print(*order_sorted)
N, C = map(int, input().split())
MAX_N = (10 ** 5 + 1)
X = [0] * MAX_N
for _ in range(N):
    s, t, c = map(int, input().split())
    X[s] += 1
    X[t+1] -= 1
# print(X)
ans = [0] * MAX_N
for i in range(MAX_N - 1):
    ans[i + 1] = ans[i] + X[i]
# print(ans)
print(max(ans))

### FIXED CODE ###

N, C = map(int, input().split())
MAX_N = (10 ** 5 + 5)
X = [[0] * MAX_N for _ in range(C)]

for _ in range(N):
    s, t, c = map(int, input().split())
    c -= 1
    X[c][s] += 1
    X[c][t + 1] -= 1
# print(X)
res = [[0] * MAX_N for _ in range(C)]
for c in range(C):
    for i in range(MAX_N - 1):
        res[c][i + 1] = res[c][i] + X[c][i]
# print(ans)
ans = 0
for i in range(MAX_N - 1):
    count = 0
    for c in range(C):
        if 0 < res[c][i]:
            count += 1
    ans = max(ans, count)
print(ans)
a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    priont("NO")

### FIXED CODE ###

a = input()
b = input()
if a[0] == b[2] and a[1] == b[1] and a[2] == b[0]:
    print("YES")
else:
    print("NO")
_,k = map(int,input().split())
a = list(filter(lambda x:x<k,list(map(int,input().split()))))
n = len(a)
a.sort(reverse=True)
dpf = [[False]*k for _ in range(n)] 
dpb = [[False]*k for _ in range(n)] 
dpf[0][0] = True
dpb[-1][0] = True
for i in range(n-1):
  wf = a[i]
  wb = a[-(i+1)]
  for j in range(k):
    if dpf[i][j]:
      dpf[i+1][j] = True
      if j+wf < k:
        dpf[i+1][j+wf] = True
    if dpb[-(i+1)][j]:
      dpb[-(i+2)][j] = True
      if j+wb < k:
        dpb[-(i+2)][j+wb] = True
        
def check(v):
  w = a[v]
  im = [0]*(k+1)
  lf = dpf[v]
  lb = dpb[v]
  for i in range(k):
    if lb[i]:
      if k-i <= 0:
        continue
      im[max(k-w-i,0)] += 1
      im[k-i] -= 1
  if lf[0] and im[0]>0:
    return False
  for i in range(1,k):
    im[i] += im[i-1]
    if lf[i] and im[i]>0:
      return False
  return True
 
ng = -1
ok = n
while ok-ng > 1:
  mid = (ok+ng)//2
  if check(mid):
    ok = mid
  else:
    ng = mid
print(n-ok)


### FIXED CODE ###

n, k = map(int,input().split())
a = [k+1 if x > k else x for x in map(int,input().split())]
a.sort()
lef = [1]*n
rig = [1]*n
mask = (1 << (k+1)) - 1
for i in range(n-1):
  lef[i+1] = lef[i] | (lef[i] << a[i]) & mask
  rig[-i-2] = rig[-i-1] | (rig[-i-1] << a[-i-1]) & mask
ok = -1
ng = n
while ng - ok > 1:
  mid = (ng + ok) // 2
  if a[mid] >= k:
      ng = mid
      continue
  lc = lef[mid]
  rc = rig[mid]
  cov = ((1 << k) - 1) ^ ((1 << (k - a[mid])) - 1)
  for i in range(k):
    if lc & 1 and rc & cov:
      ng = mid
      break
    lc >>= 1
    cov >>= 1
  else:
    ok = mid
print(ok + 1)
import sys
N, M = map(int, sys.stdin.readline().split())
A = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
S = sum(A)
if A[M] < S / (4 * M):
    print("No")
else:
    print("Yes")

### FIXED CODE ###

import sys
N, M = map(int, sys.stdin.readline().split())
A = sorted(list(map(int, sys.stdin.readline().split())), reverse=True)
S = sum(A)
if A[M - 1] < S / (4 * M):
    print("No")
else:
    print("Yes")
import math


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

A.append(X)
A.sort()

diff = []
for a,b in zip(A, A[1:]):
    diff.append(b-a)

ans = diff[0]
for i in range(1,len(diff)):
    ans = math.gcd(ans, diff[i])


print(ans)

### FIXED CODE ###

def gcd(a,b):
  if a < b:
    a, b = b, a
  while b:
    a, b = b, a % b
  return a

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

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


if len(x) == 2:
  tmp = (x[1] - x[0])
else:
  tmp = gcd((x[2] - x[1]), (x[1] - x[0]))
  for i in range(2, N):
    tmp = gcd(x[i+1] - x[i], tmp)

    
print(tmp)
N = int(input())
S, T = [input().split()]
A = ""

for i in N
	A += S[i]
	A += T[i]
    
print(A)

### FIXED CODE ###

N = int(input())
S, T = input().split()
A = str()
 
for i in range(N):
    A += S[i]
    A += T[i]
    
print(A)
a,b = map(float,input().split())
b = int(b.replace(".",""))
print(int(a*b//100))

### FIXED CODE ###

a,b = input().split()
a = int(a)
b = int(b.replace(".",""))
print(int(a*b//100))
s.replace('1','a')
s.replace('9','1')
s.replace('a','9')
print(str(n))


### FIXED CODE ###

n = input()
n = n.replace("1"," ").replace('9','1').replace(' ','9')
print(n)
import sys

lines = []
for line in sys.stdin:
    lines.append(line.strip().split(','))

field = [[0 for i in range(10)] for j in range(10)]

def drop(x, y, z):
    if z==1:
        for i in range(-1,2):
            for j in range(-1,2):
                if abs(i)+abs(j)<2 and 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1
    elif z==2:
        for i in range(-1,2):
            for j in range(-1,2):
                if 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1
    else:
        for i in range(-2,3):
            for j in range(-2,3):
                if abs(i)+abs(j)<3 and 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1



for line in lines:
    x,y,z = map(int, line)
    drop(x,y,z)

n = 0
m = 0
for f in field:
    for e in f:
        if e > m:
            m = e
        if e==0:
            n+=1

print(n)
print(m)



### FIXED CODE ###

import sys

lines = []
for line in sys.stdin:
    lines.append(line.strip().split(','))

field = [[0 for i in range(10)] for j in range(10)]

def drop(x, y, z):
    if z==1:
        for i in range(-1,2):
            for j in range(-1,2):
                if abs(i)+abs(j)<2 and 0<=y+j<=9 and 0<=x+i<=9:
                    field[y+j][x+i] += 1
    elif z==2:
        for i in range(-1,2):
            for j in range(-1,2):
                if 0<=y+j<=9 and 0<=x+i<=9:
                    field[y+j][x+i] += 1
    else:
        for i in range(-2,3):
            for j in range(-2,3):
                if abs(i)+abs(j)<3 and 0<=y+j<=9 and 0<=x+i<=9:
                    field[y+j][x+i] += 1



for line in lines:
    x,y,z = map(int, line)
    drop(x,y,z)

n = 0
m = 0
for f in field:
    for e in f:
        if e > m:
            m = e
        if e==0:
            n+=1

print(n)
print(m)
import heapq

n,m = map(int,input().split())
a_L = list(map(lambda x:int(x) * -1,input().split()))

q = heapq.heapify(a_L)


for val in range(0,m):
    a_min = heapq.heappop(q)
    a_min = (-1 * a_min)//2 * -1
    heapq.heappush(q,a_min)
    print(a_L)

print(-sum(q))


### FIXED CODE ###

import heapq

n,m = map(int,input().split())
a_L = list(map(lambda x:int(x) * -1,input().split()))

heapq.heapify(a_L)
#a_L = list(sorted(a_L))
#max_num = a_L[0]
#a_L.append(max_num)

for val in range(0,m):
    a_min = heapq.heappop(a_L)
    a_min = (-1 * a_min)//2 * -1
    heapq.heappush(a_L,a_min)

print(-sum(a_L))
a, b = map(int, input().split())
print(max(a+b, a-b, a*b))

### FIXED CODE ###

a, b = map(int, input().split())
print(max(a+b, a-b, a*b))
a, b = input().split()

if ( a < b) :
    print('<')
elsif (a > b):
    print('>')
else :
    print('=')
    

### FIXED CODE ###

a, b = input().split()

if a < b:
  print('<')
elif a>b:
  print('>')
else:
  print('=')
a,b,c,d=map(int,input().split())
a='Yes'
if abs(a-c)>d:
  if abs(a-b)>d or abs(b-c)>d:
    a='No'
print(a)

### FIXED CODE ###

a,b,c,d=map(int,input().split())
s='Yes'
if abs(a-c)>d:
  if abs(a-b)>d or abs(b-c)>d:
    s='No'
print(s)
n=input()
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)

### FIXED CODE ###

n=int(input())
l=list(map(int,input().split()))
ans=0
for i in range(n-2):
    a=l[i:i+3]
    b=a[1]
    c=sorted(a)
    if b==c[1]:
        ans+=1
print(ans)
n,k = [int() for i in input().split]
print(n-k+1)

### FIXED CODE ###

n,k = [int(i) for i in input().split()]
print(n-k+1)
if s[0]=='A':
    if s[2:-2].count('C')==1:
        if (s[1]+s[2:-2].replace('C', '')+s[-1]).islower() :
            print('AC')
        else:
            print('WA')
    else:
        print('WA')
else:
    print('WA')
 

### FIXED CODE ###

r=int(input())
if r<1200:
  print('ABC')
elif 1200<=r and r<2800:
  print('ARC')
else:
  print('AGC')
t, x, y = 0, 0, 0
tn, xn, yn = 0, 0, 0

for i in list_plan:
    tn, xn, yn = int(i[0]) - t, int(i[1]) - x, int(i[2]) - y
    tn, xn, yn = abs(tn), abs(xn), abs(yn)
    if xn + yn < tn and (tn - xn - yn)%2 == 0:
        t, x, y = i[0], i[1], i[2]
    else:
        print("No")
        exit()
        
print("Yes")
    

### FIXED CODE ###

n = int(input())
list_plan = []
for i in range(n):
    t, x, y = map(int, input().split())
    list_plan.append([t, x, y])

for i in list_plan:
    t, x, y = i[0], i[1], i[2]
    if x + y <= t and (t - x - y)%2 == 0:
        pass
    else:
        print("No")
        exit()

print("Yes")
n=int(input())
list=[input() for i in range(n)]
sorted(list)
print(abs(list[-1]-list[0]))

### FIXED CODE ###

s=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))
result = 1
if 0 in A:
    result = 0
else:
    for i in A:
        result *= i
        if result > 10**18:
            result = -1
            break

print(result)

### FIXED CODE ###

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

result = 1
A.sort()
for i in A:
    result *= i
    if result > 10**18:
        result = -1
        break

print(result)
A,B = [int(input()).split]

if abs(A-B) >= 2 :
	print(A*2-1)
elif abs(A-B) = 1 :
	print(max([A,B])+min([A,B]))
else :
	print(A*2)

### FIXED CODE ###

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

if abs(A-B) >= 2 :
	print(max([A,B])*2-1)
elif abs(A-B) == 1 :
	print(A+B)
else :
	print(A*2)
a,b,c,k = map(int,raw_input())

if k%2==0:
	print a-b
else:
	print b-a

### FIXED CODE ###

a,b,c,k = map(int,raw_input().split())

if k%2==0:
	print a-b
else:
	print b-a
a,b,c = map(int,raw_input().split())
list = [a,b,c]
ilst.sort()
for i in list :
    print i

### FIXED CODE ###

list = map(int,raw_input().split())
list.sort()
print'%d %d %d' %(list[0],list[1],list[2])
#2-1-1 #ABC104C
d,g=map(int,input().split())
q=[]
comp=[]
bornus=[]
for i in range(d):
    p,c=map(int,input().split())
    q.append(p)
    bornus.append(100*(i+1)*p+c)
    comp.append((100*(i+1)*p+c)/p)
    
p=[100*i for i in range(1,d+1)]
    
data={0:[0 for i in range(d)]}
def makemax(p,q,bornus,comp,k):
    now=0
    point=0
    pnow=p.copy()
    qnow=q.copy()
    bornusnow=bornus.copy()
    compnow=comp.copy()
    while now<k:
        compnown=compnow.copy()
        kagen=max(pnow)
        kagenidx=pnow.index(kagen)
        kagen_num=qnow[kagenidx]
        for i in range(d):
            maxcomp=max(compnown)
            compnown.pop(compnow.index(maxcomp))
            maxidx=compnow.index(maxcomp)
            if maxcomp<kagen:break
            if qnow[maxidx]>k-now:continue
            point+=bornusnow[maxidx]
            now+=qnow[maxidx]
            compnow[maxidx]=0
            pnow[maxidx]=0
            if maxidx==kagenidx:
                if len(pnow)!=0:
                    kagen=max(pnow)
                    kagenidx=pnow.index(kagen)
                    kagen_num=qnow[kagenidx]
                else:
                    kagen=-1
        if kagen==-1:break
        adit=min(k-now,kagen_num)
        if adit==kagen_num:
            point+=bornusnow[kagenidx]
            now+=kagen_num
        elif adit<kagen_num:
            point+=adit*kagen
            now+=adit
        compnow[kagenidx]=0
        pnow[kagenidx]=0
    return point

ans=-1
k=0
while ans==-1:
    if makemax(p,q,bornus,comp,k)>=g:
        ans=k
        
    k+=1
print(ans)

### FIXED CODE ###

d,g = map(int,input().split())
q={}
comp={}
p={}
minsolve=0
for i in range(d):
    a,b=map(int,input().split())
    q[i]=a
    p[i]=100*(i+1)
    comp[i]=100*(i+1)*a+b
    minsolve+=a
    
solve=[0 for _ in range(d)]
def roop(s,check,point,solved,minsolve):
    solve=s.copy()
    solve2=s.copy()
    if check==d:
        if point>g:
            minsolve=min(minsolve,solved)
            return minsolve
        if 0 in solve:
            solverev=solve.copy()
            solverev.reverse()
            idx=d-solverev.index(0)-1
            shold=1+(g-point-1)//p[idx]
            if q[idx]>shold and shold>=0:
                solved+=shold
                minsolve=min(minsolve,solved)
        return minsolve

    minsolve=roop(solve,check+1,point,solved,minsolve)
    solve2[check]+=1
    minsolve=roop(solve2,check+1,point+comp[check],solved+q[check],minsolve)
    return minsolve

print(roop(solve,0,0,0,minsolve))