Harryxun/stf_run huggingface dataset:
A, B, C = map(int, input().split())
K = int(input())


def combinations(k):
    result = []
    for a in range(k + 1):
        for b in range(k + 1):
            for c in range(k + 1):
                if a + b + c <= k:
                    result.append([a, b, c])

    return result


def magic(A, B, C, K):
    if A < B < C:
        return True

    for l in combinations(K):
        a, b, c = A, B, C
        a_count, b_count, c_count = l
        if a_count > 0:
            a *= 2 * a_count
        if b_count > 0:
            b *= 2 * b_count
        if c_count > 0:
            c *= 2 * c_count

        if a < b < c:
            return True

    return False


if (magic(A, B, C, K)):
    print('Yes')
else:
    print('No')


### FIXED CODE ###

N, K = map(int, input().split())
A_LIST = list(map(int, input().split()))

for index in range(K, N):
    if A_LIST[index] > A_LIST[index - K]:
        print('Yes')
    else:
        print('No')
import sys
sys.setrecursionlimit(10**9)

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

def f(a,b) :
    if a < b :
        return 2*a + f(a,b-a)
    elif a > b :
        return 2*b + f(b,a-b)
    else :
        return a

ans = N + f(X,N-X)

print(ans)


### FIXED CODE ###

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

def f(a,b) :
    if a > b :
        a,b = b,a
    if b % a == 0 :
        return 2*(b//a-1)*a + a
    else :
        return 2*(b//a)*a + f(a,b%a)
        
ans = N + f(X,N-X)

print(ans)
import math


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**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([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = math.gcd(a, b)
if g == 1:
    print('1')
else:
    print(len(factorization(g))+1)

### FIXED CODE ###

from fractions import gcd


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**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([n, 1])

    return arr


a, b = list(map(int, input().split()))
g = gcd(a, b)
if g == 1:
    print('1')
else:
    print(len(factorization(g))+1)
N, M = map(int, input().split())
A = list(map(int, input().split()))
A.sort()

for _ in range(M):
	a = A.pop()
	a //= 2
	for i in A:
		if i > a:
			A.insert(A.index(i), a)
			break

sum = 0
for a in A: sum += a
print(sum)

### FIXED CODE ###

import heapq

N, M = map(int, input().split())
A = list(map(int, input().split()))
h = []

for a in A: heapq.heappush(h, -a)
for _ in range(M):
	a = heapq.heappop(h) * -1
	a //= 2
	heapq.heappush(h, -a)

sum = 0
for _ in range(N): 
	sum -= heapq.heappop(h)
print(sum)
def resolve():
    n, s = map(int, input().split())
    a = list(map(int,input().split()))
    dp = [[0]*(s+10) for _ in range(n+10)]
    dp[0][0] = 1
    mod = 998244353
    for i in range(1,n+1):
        nexta = a[i-1]
        for j in range(0, s+1):
            dp[i][j] += (2 * dp[i - 1][j])% mod
            if j + nexta > s:
                continue
            else:
                dp[i][j+nexta] += (dp[i-1][j])%mod
    print((dp[n][s])%mod)
resolve(()

### FIXED CODE ###

def resolve():
    n, s = map(int, input().split())
    a = list(map(int,input().split()))
    dp = [[0]*(s+10) for _ in range(n+10)]
    dp[0][0] = 1
    mod = 998244353
    for i in range(1,n+1):
        nexta = a[i-1]
        for j in range(0, s+1):
            dp[i][j] += (2 * dp[i - 1][j])% mod
            if j + nexta > s:
                continue
            else:
                dp[i][j+nexta] += (dp[i-1][j])%mod
    print((dp[n][s])%mod)
resolve()
def binary_search(l, value):
    if len(l) == 0:
        return 0
    if len(l) < 4:
        for i in range(len(l)):
            if value <= l[i]:
                return i
    low = 0
    high = len(l) - 1
    while low <= high:
        mid = (low + high) // 2
        if l[mid-1] <= value <= l[mid]:
            return mid
        elif l[mid] < value:
            low = mid + 1
        else:
            high = mid - 1
    return mid
    
n, m = map(int,input().split())
A = list(map(int,input().split()))
A.sort()
from collections import deque
d = deque(A)
for _ in range(m):
    max_ = d.pop()
    tmp = max_ // 2
    index = binary_search(d, tmp)
    d.insert(index, tmp)
print(sum(d))



### FIXED CODE ###

n, m = map(int,input().split())
A = list(map(int,input().split()))
A = [x * -1 for x in A]
A.sort()
import heapq
import bisect
heapq.heapify(A)
for _ in range(m):
    min_ = heapq.heappop(A)
    tmp = min_ * -1 // 2 * -1
    index = bisect.bisect_left(A, tmp)
    heapq.heappush(A,tmp)
print(sum(A) * -1)
S = list(input())
for i in range(len(S)):
  if S[0] == "K":
    S.insert(0,"A")
for i in range(len(S)):
  if S[i] == "H" and S[i+1] != "A":
    S.insert(i+1,"A")
for i in range(len(S)):
  if S[i] == "B" and S[i+1] != "A":
    S.insert(i+1,"A")
for i in range(len(S)):
  if S[-1] == "R":
if "".join(S) == "AKIHABARA":
  print("YES")
else:
  print("NO")


### FIXED CODE ###

S = list(input())
for i in range(len(S)):
  if S[0] == "K":
    S.insert(0,"A")
for i in range(len(S)):
  if S[i] == "H" and S[i+1] != "A":
    S.insert(i+1,"A")
for i in range(len(S)):
  if S[i] == "B" and S[i+1] != "A":
    S.insert(i+1,"A")
for i in range(len(S)):
  if S[-1] == "R":
    S.append("A")

if "".join(S) == "AKIHABARA":
  print("YES")
else:
  print("NO")
W, H, x, y = map(int, input().split())

one =  W * (H-y)
two = x * H
three = 0
same = 0
if x==0 and y==0:
  three = (W*H)/2
if x==W and y==H:
  three = (W*H)/2
if x==0 and y==H:
  three = (W*H)/2
if x==W and y==0:
  three = (W*H)/2

if W == H:
  if x==y:
    three = (W*H)/2
  elif x==(W+1)-y:
    three = (W*H)/2
  

if x == W/2 and y == H/2:
  same = 1

print(max(one, two, three), same)



### FIXED CODE ###

x, a = map(int, input().split())
if x < a:
  print(0)
else:
  print(10)
def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

dp = [][]

for i in range(n):
  for m in range(p):
    dp[i][m] == -1

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'

### FIXED CODE ###

def solve(i, m):
  if dp[i][m] != -1:
    return dp[i][m]

  if m == 0:
    dp[i][m] = 1
  elif i >= n:
    dp[i][m] = 0
  elif solve(i+1, m):
    dp[i][m] = 1
  elif solve(i+1, m-A[i]):
    dp[i][m] = 1
  else:
    dp[i][m] = 0

  return dp[i][m]



n = input()
A = map(int, raw_input().split())
p = input()
m = map(int, raw_input().split())

dp = [[-1 for col in range(2000)] for row in range(n+1)]

for i in range(p):
  if solve(0, m[i]):
    print 'yes'
  else:
    print 'no'
def main():
    z = [-1] * 10
    n = int(input())
    xy = []
    for _ in range(n):
        a = int(input())
        xy.append([list(map(int, input().split())) for _ in range(a)])
    ans = 0
    
    for a in range(2**n):
        c = []
        for b in range(n):
            c.append(a >> b & 1)
       
        flag = True
        for i in range(n):
            if c[i] == 1:
                for x, y in xy[i]:
                    if z[x - 1] == -1 or z[x - 1] == y:
                        z[x - 1] = y
                    else:
                        flag = False
            
        for i in range(n):
            if z[i] != -1:
                if z[i] !=c[i]:
                    flag = False
                        
        if flag:
            ans = max(ans, sum(c))
    
    print(ans)
        
    
if __name__ == '__main__':
    main()

### FIXED CODE ###

def main():
    xy = []
    n = int(input())
    for _ in range(n):
        a = int(input())
        xy.append([list(map(int, input().split())) for _ in range(a)])
    ans = 0
    
    for a in range(2**n):
        c = []
        for b in range(n):
            c.append(a >> b & 1)
       
        flag = True
        for i in range(n):
            if c[i] == 1:
                for x, y in xy[i]:
                    if c[x - 1] != y:
                        flag = False
                        
        if flag:
            ans = max(ans, sum(c))
    
    print(ans)
        
    
if __name__ == '__main__':
    main()
# -*- coding: utf-8 -*-

def parse_input():
    line = [int(e) for e in input().split(" ")]
    a = line[0]
    b = line[1]

    returnr (a, b)


def solve(a, b):

    result = 0
    if b % a == 0:
        result = a + b
    else:
        result = b - a

    return str(result)

def main():
    # 出力

    a, b = parse_input()
    print(solve(a, b))

if __name__ == '__main__':

    main()


### FIXED CODE ###

# -*- coding: utf-8 -*-

def solve(l1):

    l = [int(e) for e in l1.split(" ")]
    a = l[0]
    b = l[1]

    result = 0
    if b % a == 0:
        result = a + b
    else:
        result = b - a


    return str(result)

def main():
    # 出力
    params = []
    for i in range(0, 1):
        params.append(input())   
    print(solve(*params))

if __name__ == '__main__':

    main()
a = [list(map(int, input().split())) for _ in range(3)]
n = int(input())
b = [int(input()) for _ in range(n)]

Size = 3
bingo = False
for row in a:
    if all(item in b for item in row):
        bingo = True
for col in zip(*a):
    if all(item in b for item in col):
        bingo = True
if all(a[i][i] in b for i in range(Size)):
    bingo = True
if all(a[i][Size - 1 - i] in b for i in range(Size)):
    bingo = True
 
print("Yes" if bingo else "No")

### FIXED CODE ###

n = int(input())
a = n // 2
b = n % 2
print(a + b)
#-*- coding: utf-8 -*-
def knapsack2(items, W):
    N = len(items)
    C = [[0 for _i in xrange(W+1)] for _j in xrange(N+1)]
    for i in range(N+1)[1:]:
        v, w = items[i-1]
        for j in range(W+1)[1:]:
            if j < w:
                C[i][j] = C[i-1][j]
            else:
                C[i][j] = max(C[i-1][j-w]+v, C[i-1][j])

    return C[-1][-1]

N, W = [int(i) for i in raw_input().split()]
wvlist = input_str(N)
items = [(int(v), int(w)) for w, v in wvlist]
print knapsack2(items, W)

### FIXED CODE ###

# -*- coding: utf-8 -*-
def input_str(row):
    res = []
    for _ in range(row):
        res.append(raw_input().split())
    return res

ipt = input_str(2)
N, T = [int(i) for i in ipt[0]]
t = sorted([int(i) for i in ipt[1]])

total = 0
for i, ti in enumerate(t[:-1]):
    if t[i+1] - t[i] > T:
        total += T
    else:
        total += t[i+1] - t[i]

print total + T
n,m = map(int, input())
if n >= m:
    print('Yes')
else:
    print('No')

### FIXED CODE ###

n,m = map(int, input().split())
if n == m:
    print('Yes')
else:
    print('No')
import math

def test(a,b):
  num = 2
  x = math.gcd(a,b)
  s = []
  while x != 1:
    if(x % num == 0):
      x = x / num
      s.append(num)
    else:
      num += 1

  return set(s)

def main():

  a, b = map(int, input().split())

  num = []

  num = list(test(a, b))
  num.append(1)
  print(len(num))

if __name__ == '__main__':
  main()


### FIXED CODE ###

from fractions import gcd
import math

def test(a,b):
  x = gcd(a,b)
  s = []
  for i in range(2, int(math.sqrt(x)) + 1):
    while x % i == 0:
      s.append(i)
      x //= i

  s.append(x)
  s.append(1)

  return list(set(s))

def main():

  a, b = map(int, input().split())

  num = []

  num = test(a, b)
  print(len(num))

if __name__ == '__main__':
  main()
n,k = map(int,input().split())


import math
i = 1

while i <= k:
  print((int(math.factorial(n-k+i)/(math.factorial(n-k))/(math.factorial(i))))%(10**9 + 7))
  i += 1

### FIXED CODE ###

import math
 
def combination_count(n,k):
    if k > n or k < 0:
        return 0
    if n == 0 or k == 0:
        return 1
    
    s = math.factorial(n)
    t = math.factorial(k)
    u = math.factorial(n-k)
    
    return s//(t*u)
    
n,k = map(int,input().split())
 
mod = 10**9 + 7
 
for i in range(1,k+1):
    x = combination_count(n-k+1,i) * combination_count(k-1, i-1)
    print(x%mod)
from math import gcd
from math import sqrt


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**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([n, 1])

    return arr


A, B = map(int, input().split())
if (A == 1 or B == 1 or A % B != 0):
    print(1)
    exit(0)
if (A == B):
    print(2)
    exit(0)

C = gcd(A, B)
arr = factorization(C)
#print(arr)
print(len(arr) + 1)


### FIXED CODE ###

from fractions import gcd
from math import sqrt


def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**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([n, 1])

    return arr


def main():
    A, B = map(int, input().split())
    C = gcd(A, B)
    if (C == 1):
        print(1)
        exit(0)
    arr = factorization(C)
    # print(arr)
    print(len(arr) + 1)


if __name__ == "__main__":
    main()
N, K = map(int, input().split())
X = list(map(int, input().split()))
Y = []
Z = []
zc = 0
for i in range(N):
    if X[i] > 0:
        Y.append(X[i])
    if X[i] == 0:
        zc = 1
for i in range(N-1, -1, -1):
    if X[i] < 0:
        Z.append(-X[i])

cs = []
K -= zc
if K == 0:
    print(0)
else:
    if len(Y) >= K:
        cs.append(Y[K-1])
    if len(Z) >= K:
        cs.append(Z[K-1])
    for i in range(K-1):
        cs.append(2*Y[i]+Z[K-i-2])
    for i in range(K-1):
        cs.append(2*Z[i]+Y[K-i-2])
print(min(cs))


### FIXED CODE ###

N, K = map(int, input().split())
X = list(map(int, input().split()))
Y = []
Z = []
zc = 0
for i in range(N):
    if X[i] > 0:
        Y.append(X[i])
    if X[i] == 0:
        zc = 1
for i in range(N-1, -1, -1):
    if X[i] < 0:
        Z.append(-X[i])

cs = []
K -= zc
if K == 0:
    print(0)
else:
    if len(Y) >= K:
        cs.append(Y[K-1])
    if len(Z) >= K:
        cs.append(Z[K-1])
    for i in range(min(K-1, len(Y))):
        if K-i-2 < len(Z):
            cs.append(2*Y[i]+Z[K-i-2])
    for i in range(min(K-1, len(Z))):
        if K-i-2 < len(Y):
            cs.append(2*Z[i]+Y[K-i-2])
    print(min(cs))
a,b,c = map(int,input().split())Liste= list(map(str,input().split()))
P = Liste.count('5')
Q = Liste.count('7')
if P == 2 and Q == 1:
    print('YES')
else:
    print('NO')

### FIXED CODE ###

Liste= list(map(str,input().split()))
P = Liste.count('5')
Q = Liste.count('7')
if P == 2 and Q == 1:
    print('YES')
else:
    print('NO')
ta, b, c, d = map(int, input().split())
while True:
    c -= b
    if c <= 0:
        print('Yes')
        break
    a -= d
    if a <= 0:
        print('No')
        break

### FIXED CODE ###

a, b, c, d = map(int, input().split())
while True:
    c -= b
    if c <= 0:
        print('Yes')
        break
    a -= d
    if a <= 0:
        print('No')
        break
import sys

a, b, x = map(int(), input().split())

if(x > a*a*b):
    sys.exit()

suito = a * a * b

wariai = 0

wariai = x / suito

kakudo = 0
kakudo =90 * wariai
print(90-kakudo)


### FIXED CODE ###

import sys
import math

a, b, x = map(int, input().split())


if(x > a*a*b):
    sys.exit()

if (a*a*b/2 >= x):
    s = math.degrees(math.atan(a*b*b/2/x))
else:
    s = math.degrees(math.atan(2*(a*a*b-x)/a/a/a))

print (s)
import numpy as np

n=int(input())
if n==1:
    print(0)
else:
    plist=list(range(1,n+1))
    qlist=list(range(2,n+1))
    qlist.append(1)
    parray=np.array(plist)
    qarray=np.array(qlist)
    rarray=parray%qarray
    sm=rarray.sum()
    print(sm)


### FIXED CODE ###

import numpy as np

n=int(input())
print(int((n-1)*n//2))
"""
if n==1:
    print(0)
else:
    plist=list(range(1,n+1))
    qlist=list(range(2,n+1))
    qlist.append(1)
    parray=np.array(plist)
    qarray=np.array(qlist)
    rarray=parray%qarray
    sm=rarray.sum()
    print(sm)
"""
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))
k_max = 5100
score = [0] * N

for i in range(N):
  score_i = [-10**18-1] * k_max # iからスタートしてK回操作する場合の累積和
  score_i[0] = C[P[i]-1]
  index = P[i]-1
  for k in range(1, K):
    if index == i:
      # 既に進んだことがあるマスの場合
      
      # ループ終了インデックスからループ開始インデックスの累積和の差を確認
      loop_score = score_i[k-1] # 1ループで増えるスコア
      if loop_score > 0:
        loop_num = k # ループする要素数はk(indexが0 ~ k-1)
        
        tmp_score = [-10**18-1] * k_max
        tmp_score[0] = (K//k -1) * loop_score
#        print("loop_score", loop_score)
#        print("tmp_score", tmp_score)
        tmp_index = index
        for j in range (1, loop_num + K%k+1):
          tmp_score[j] = tmp_score[j-1] + C[P[tmp_index]-1]
          tmp_index = P[tmp_index]-1
#        print("max(tmp_score)", max(tmp_score))
        score_i[k] = max(tmp_score)
      else:
        score[i] = max(score_i)
      break
    score_i[k] = score_i[k-1] + C[P[index]-1]
    index = P[index]-1
  score[i] = max(score_i)
print(max(score))

### FIXED CODE ###

# -*- coding: utf-8 -*-
N, K = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))
k_max = 10100
score = [-10**18-1] * N

for i in range(N):
  score_i = [-10**18-1] * k_max # iからスタートしてK回操作する場合の累積和
  score_i[0] = C[P[i]-1]
  index = P[i]-1
  for k in range(1, K):
    if index == i:
      # 既に進んだことがあるマスの場合
      
      loop_score = score_i[k-1] # 1ループで増えるスコア
      if loop_score > 0:
        loop_num = k # ループする要素数はk(indexが0 ~ k-1)
        
        tmp_score = [-10**18-1] * k_max
        tmp_score[0] = (K//k -1) * loop_score
#        print("loop_score", loop_score)
#        print("tmp_score", tmp_score)
        tmp_index = index
#        print("loop_num + K%k + 1", loop_num + K%k + 1)
        for j in range (1, loop_num + K%k + 1):
          tmp_score[j] = tmp_score[j-1] + C[P[tmp_index]-1]
          tmp_index = P[tmp_index]-1
#        print("max(tmp_score)", max(tmp_score))
        score_i[k] = max(tmp_score)
      break
    score_i[k] = score_i[k-1] + C[P[index]-1]
    index = P[index]-1
  score[i] = max(score_i)
print(max(score))
import sys
import math

line = []
for l in sys.stdin:
    for i in l.split(' '):
    	line.append(float(i))
a = (line[0]-line[2])**2+(line[1]-line[3])**2
b = math.sqrt(a)
print ('%03.4f' % b)

### FIXED CODE ###

import math

x1,y1,x2,y2 = map(float,raw_input().split())
a = math.sqrt((x1-x2)**2+(y1-y2)**2)
print '%f'%a
from math import *
while True:
    n = int(input())
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/2)
    
    print(c)


### FIXED CODE ###

from math import *
while True:
    n = int(input())
    if(n == 0 ): break
    data = list(map(int,input().split()))  
    a = sum(data) / n
    b = 0
    c = 0
    for i in data:
        b += pow(i-a,2)
    c = sqrt(b/n)
    
    print(c)
s=input
ss=s[0:3]+" "+s[4:]
print(ss)

### FIXED CODE ###

s=input()
ss=s[0:4]+" "+s[4:]
print(ss)
s = list(input())
K = int(input())
alphabet = "abcdefghijklmnopqrstuvwxyz"

for i in range(len(s)):
    if K >= 26 or s[i] >= alphabet[-K]:
        K -= ord("z") - ord(s[i]) + 1
        s[i] = "a"

if K > 0:
    K %= 26
    if (chr(ord(s[-1]) + K) <= "z"):
        s[-1] = chr(ord(s[-1]) + K)
    else:
        s[-1] = chr(ord("a") + K)

print("".join(s))

### FIXED CODE ###

s = list(input())
k = int(input())

for i in range(len(s)):
    if s[i] == "a": continue

    diff = ord("z") - ord(s[i]) + 1

    if diff <= k:
        k -= diff
        s[i] = "a"

if k > 0:
    k %= 26
    s[i] = chr(ord(s[i]) + k)

print("".join(s))
import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,Q=map(int,input().split())
    c=[0]*N
    d={}
    for i in range(N-1):
        a,b=map(int,input().split())
        d[b-1]=a-1
    d2={}
    for i in range(Q):
        p,x=map(int,input().split())
        if p-1 in d2:
            d2[p-1]+=x
        else:
            d2[p-1]=x
    if 0 in d2:
        c[0]+=d2[0]
    for i in range(1,N):
        if i in d2:
            c[i]+=d2[i]
        c[i]+=c[d[i]]
    print(*c)
    

if __name__ == '__main__':
    main()


### FIXED CODE ###

import sys
sys.setrecursionlimit(10**9)
INF=10**18
def input():
    return sys.stdin.readline().rstrip()

def main():
    N,Q=map(int,input().split())
    a=[0]*(N-1)
    b=[0]*(N-1)
    cns=[[] for _ in range(N)]
    for i in range(N-1):
        a[i],b[i]=map(lambda x: int(x)-1,input().split())
        cns[a[i]].append(b[i])
        cns[b[i]].append(a[i])
    l_x=[0]*N
    for i in range(Q):
        p,x=map(int,input().split())
        l_x[p-1]+=x
    c=[0]*N
    c[0]+=l_x[0]
    def saiki(pn,ppn,x):
        for cn in cns[pn]:
            if cn != ppn:
                z=x+l_x[cn]
                c[cn]+=z
                saiki(cn,pn,z)
        return
    saiki(0,0,c[0])
    print(*c)
    

if __name__ == '__main__':
    main()
p = []
c = []
d, g = map(int, input().split())
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

ans_list = []

def dfs(i, p, c, res, count):
    if i == 0:
        if res >= g:
            ans_list.append(count)
    else:
        for j in range(p[i - 1] + 1):
            _count = count + j
            _res = res + 100 * j * i
            if j == p[i - 1]:
                _res += c[i - 1]
            dfs(i - 1, p, c, _res, _count)

dfs(d, p, c, res, count)
print(min(ans_list))

### FIXED CODE ###

import numpy as np
d, g = map(int, input().split())
p = []
c = []
for _ in range(d):
    _p, _c = map(int, input().split())
    p.append(_p)
    c.append(_c)

s = np.arange(1, d + 1) * 100
p = np.array(p)

ans_list = []

bool_list = [False] * d

state_list = []

def dfs(i, n, bool_list):
    bool_list = bool_list.copy()
    if i == n:
        state_list.append(bool_list)
    else:
        dfs(i + 1, n, bool_list)
        bool_list[i] = True
        dfs(i + 1, n, bool_list)

dfs(0, d, bool_list)

for state in state_list:
    if np.dot(s * p, state) + np.dot(c, state) >= g:
        ans_list.append(np.dot(p, state))
    else:
        score = max(s * np.array([not i for i in state]))
        for j in range(1, p[score//100 - 1] + 1):
            if np.dot(s * p, state) + np.dot(c, state) + score * j >= g:
                ans_list.append(np.dot(p, state) + j)

print(min(ans_list))
X, Y ＝ map(int, input().split())
for crane in range(X+1):
  turtle = X - crane
  if crane * 2 + turtle * 4 == Y:
    print('Yes')
    exit()
print('No')


### FIXED CODE ###

X, Y = map(int, input().split())
for crane in range(X+1):
  turtle = X - crane
  if crane * 2 + turtle * 4 == Y:
    print('Yes')
    exit()
print('No')
N = input()
    if N[0] == '7' or N[1] == '7' or N[2] == '7':
        print("Yes")
    else:
        print("No")

### FIXED CODE ###

N = input()
if N[0] == '7' or N[1] == '7' or N[2] == '7':
   print("Yes")
else:
   print("No")
a,b=[str(i) for i in input().split()]
list1=["1","3","5","7","8","10","12"]
list2=["4","6","9","11"]
if a,b in list1 or a,b in list2:
  print('Yes')
else:
  print('No')

### FIXED CODE ###

a,b=[str(i) for i in input().split()]
list1=["1","3","5","7","8","10","12"]
list2=["4","6","9","11"]
if a in list1 and b in list1:
  print('Yes')
elif a in list2 and b in list2:
  print('Yes')
else:
  print('No')