A programming competition site AtCode provides algorithmic problems.
Each problem is allocated a score based on its difficulty.
Currently, for each integer i between 1 and D (inclusive), there are p_i problems with a score of 100i points.
These p_1 + … + p_D problems are all of the problems available on AtCode.
A user of AtCode has a value called total score.
The total score of a user is the sum of the following two elements:
 - Base score: the sum of the scores of all problems solved by the user.
 - Perfect bonuses: when a user solves all problems with a score of 100i points, he/she earns the perfect bonus of c_i points, aside from the base score (1 ≤ i ≤ D).
Takahashi, who is the new user of AtCode, has not solved any problem.
His objective is to have a total score of G or more points.
At least how many problems does he need to solve for this objective?

-----Constraints-----
 - 1 ≤ D ≤ 10
 - 1 ≤ p_i ≤ 100
 - 100 ≤ c_i ≤ 10^6
 - 100 ≤ G
 - All values in input are integers.
 - c_i and G are all multiples of 100.
 - It is possible to have a total score of G or more points.

-----Input-----
Input is given from Standard Input in the following format:
D G
p_1 c_1
:
p_D c_D

-----Output-----
Print the minimum number of problems that needs to be solved in order to have a total score of G or more points. Note that this objective is always achievable (see Constraints).

-----Sample Input-----
2 700
3 500
5 800

-----Sample Output-----
3

In this case, there are three problems each with 100 points and five problems each with 200 points. The perfect bonus for solving all the 100-point problems is 500 points, and the perfect bonus for solving all the 200-point problems is 800 points. Takahashi's objective is to have a total score of 700 points or more.
One way to achieve this objective is to solve four 200-point problems and earn a base score of 800 points. However, if we solve three 100-point problems, we can earn the perfect bonus of 500 points in addition to the base score of 300 points, for a total score of 800 points, and we can achieve the objective with fewer problems.

Difficulty: introductory

Starter code:

Solutions:
import sys
sys.setrecursionlimit(10 ** 6)

D,G=map(int,input().split())
p=[]
c=[]
for i in range(D):
  a,b=map(int,input().split())
  p += [a]
  c += [b]

def solve(bit):
  if bit >= (1<<D):
    return 1000
  p_sum=0
  num=0
  for i in range(D):
    if bit & (1<<i):
      p_sum += c[i] + p[i] * 100*(i+1)
      num += p[i]
  if p_sum >= G:
    return min(num,solve(bit+1))
  else:
    for i in reversed(range(D)):
      if bit & 1<<i:
        continue
      for j in range(p[i]):
        if p_sum >= G:
          break
        p_sum += 100*(i+1)
        num += 1
      else:
        return solve(bit+1)
    return min(num,solve(bit+1))

print(solve(0))

def main():
  ans = 1000
  d,g  = map(int,input().split())
  pc = [list(map(int,input().split())) for i in range(d)]
  pc.reverse()
  #print(pc)
  for i in range( 2 ** d):
    score = 0
    count = 0
    for j in range(d):
      if i & (1<<j):
        score += pc[j][0] * (d-j) * 100 + pc[j][1]
        count += pc[j][0]
    if score >= g:
      if ans > count:
        ans = count
      #print(bin(i),count,score)
      continue
    for j in range(d):
      if not(i &(1<<j)):
        #print("nokori"+str(j))
        c = 0
        for k in range(1,pc[j][0]):
          score += (d-j) * 100
          count += 1
          c += 1
          if score >= g:
            if ans > count:
              ans = count
            #print(bin(i),j,c,count,score)
            break
        break
  print(ans)

def __starting_point():
  ans = 0
  main()
__starting_point()

def dfs(i, sum, count, rest):
    nonlocal ans
    if i == d:
        if sum < g:
            rest_max = max(rest)
            n = min(l[rest_max-1][0], -(-(g-sum)//(rest_max*100)))
            count += n
            sum += n * rest_max * 100
        if sum >= g:
            ans = min(ans, count)
    else :
        dfs(i+1, sum, count, rest) #二分岐のうち解かない選択
        dfs(i+1, sum + l[i][0]*(i+1)*100+l[i][1], count + l[i][0], rest - {i+1}) #解く選択

d, g = list(map(int, input().split()))
l = [list((list(map(int, input().split())))) for _ in range(d)]
ans = float("inf")
dfs(0, 0, 0, set(range(1, d+1)))
print(ans)


d,g = map(int, input().split())
point = [list(map(int,input().split())) for i in range(d)]

point = point[::-1]

ans = float("inf")
for bit in range(1<<d):
  total=0
  cnt=0
  for i in range(d):
    if (bit>>i)&1:
      total += (100*(d-i)*point[i][0]+point[i][1])
      cnt += point[i][0]
  if total >= g:
    ans = min(ans,cnt)
    continue
  for j in range(d):
    if (bit>>j)&1 == False:
      for k in range(point[j][0]):
        total += 100*(d-j)
        cnt += 1
        if total >= g:
          ans=min(ans,cnt)
          break
      break
print(ans)

d, g = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for i in range(d)]
def dfs(ind,score):
  if ind == 0:
    return float("inf")
  cnt = min(score//(ind*100),pc[ind][0])
  add_sc = cnt*(ind*100)
  if cnt == pc[ind][0]:
    add_sc += pc[ind][1]
  if add_sc < score:
    cnt += dfs(ind-1,score-add_sc)
  return min(cnt,dfs(ind-1,score))
 
print(dfs(d,g))

import itertools as itr

D,G=map(int, input().split())
p=[list(map(int, input().split()))  for _ in range(D)]
b=list(itr.product(range(2),repeat=D))

ans=float('INF')

for i in range(len(b)):
    temp=0
    pnt=0
    for j in range(D):
        if b[i][j]==1:
            temp+=p[j][0]
            pnt+=(j+1)*100*p[j][0]
            pnt+=p[j][1]

    if pnt>=G:
        ans=min(ans,temp)
        
    else:
        for j in range(D):
            if b[i][-j-1]==0:
                for k in range(p[-j-1][0]-1):
                    temp+=1
                    pnt+=(D-j)*100
                    if pnt>=G:  
                        ans=min(ans,temp)
                        break
                break
                
print(int(ans))

D,G = map(int,input().split())
dic1 = {}
dic2 = {}
dic3 = []
min_ans = 10000000000
#dicはdic[点数][問題数][コンプリート]
for i in range(1,D+1):
    p,c = map(int,input().split())
    dic1[i*100] = p
    dic2[i*100] = i*100*p+c
    dic3.append(i*100)

n = len(dic1)
for i in range(2 ** n):
    bag = []
    bag_sum = 0
    bag_len = 0
    for j in range(n):
        if ((i >> j) & 1):
            bag.append(dic3[j])
    for k in range(len(bag)):
        bag_sum += dic2[bag[k]]
        bag_len += dic1[bag[k]]

    if bag_sum >= G:
        min_ans = min(min_ans,bag_len)
    else:
        for i in range(len(dic3)):
            if dic3[(i+1)*-1] in bag:
                continue
            for u in range(dic1[dic3[(i+1)*-1]]-1):
                bag_len += 1
                bag_sum+=dic3[(i+1)*-1]
                if bag_sum >= G:

                    min_ans = min(min_ans,bag_len)
                    break

    
print(min_ans)

D,G=list(map(int,input().split()))
s=[list(map(int,input().split())) for _ in range(D)]

ans=10000
for i in range(2**D):
    score=0
    cnt=0
    rest=[]
    for j in range(D):
        if (i>>j)&1:
            score+=100*(j+1)*s[j][0]+s[j][1]
            cnt+=s[j][0]
        else:
            rest.append(j)

    if score<G:
        r=rest[-1]
        for _ in range(s[r][0]-1):
            score+=100*(r+1)
            cnt+=1
            if score>=G: break

    if score>=G:
        ans=min(cnt,ans)

print(ans)


[D,G],*li = [list(map(int,i.split())) for i in open(0)]

ans = float('inf')

def dfs(i,ten,num,p):
    nonlocal ans
    if i==D:
        if ten >= G:
            ans = min(ans,num)
        else:
            for q in p:
                for r in range(li[q][0]):
                    ten += (q+1)*100
                    num += 1
                    if r==li[q][0]:
                        ten += li[q][1]
                    if ten >= G:
                        ans = min(ans,num)
                        break
                else:continue
                break
    else:
        dfs(i+1,ten+(i+1)*100*li[i][0]+li[i][1],num+li[i][0],p)
        dfs(i+1,ten,num,[i]+p)
dfs(0,0,0,[])
print(ans)

D, G = list(map(int, input().split())) #D: 問題数, G: 目標点
PC = [list(map(int, input().split())) for i in range(D)]

ans = float("inf")

for i in range(2**D):
    tmp = 0
    cnt = 0
    dic = set(range(1, D+1))
    for j in range(D):
        if (i >> j)&1: #その問題は全て解く
            tmp += PC[j][0] * (j+1) * 100 + PC[j][1]
            cnt += PC[j][0]
            dic.discard(j+1)

    if tmp < G:
        t = max(dic)
        p, c = PC[t-1][0], PC[t-1][1]
        if t*100*p+c+tmp >= G:
            while p:
                tmp += t*100
                cnt += 1
                if tmp >= G:
                    break
            ans = min(ans, cnt)
    else:
        ans = min(ans, cnt)
print(ans)


from math import ceil
D, G = map(int,input().split())
ps, cs = [], []
for _ in range(D):
    p, c = map(int,input().split())
    ps.append(p)
    cs.append(c)
ans = float("inf")
for i in range(2**D):
    cnt = 0
    point = 0
    for j in range(D):
        if (i>>j)&1:
            cnt += ps[j]
            point += ps[j]*100*(j+1)+cs[j]
    if point >= G:
        ans = min(ans, cnt)
        continue
    for j in range(D-1, -1, -1):
        if (i>>j)&1 == 0:
            if (ps[j]-1)*100*(j+1)+point >= G:
                cnt += ceil((G-point)/100/(j+1))
                point += ceil((G-point)/100/(j+1))*100*(j+1)
                break
            else:
                cnt += (ps[j]-1)
                point += (ps[j]-1)*100*(j+1)
    if point >= G:
        ans = min(ans, cnt)
print(ans)

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float('inf')

for i in range(1<<d):
  count = 0
  sum = 0
  nokori = set(range(1, d+1))
  
  for j in range(d):
    if i & (1 << j):
      sum += pc[j][0]*(j+1)*100 + pc[j][1]
      count += pc[j][0]
      nokori.discard(j+1)
      
  if sum<g:
    use = max(nokori)
    n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
    count += n
    sum += n*use*100
    
  if sum>=g:
    ans = min(ans, count)
    
print(ans)

def dfs(i, sum, count, nokori):
    nonlocal ans
    if i == d:
        if sum < g:
            use = max(nokori)

            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
            
    else:
        dfs(i+1, sum, count, nokori)
        dfs(i+1, sum + pc[i][0] * (i+1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d+1)))
print(ans)

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    D, G = LI()
    pc = [LI() for _ in range(D)]

    # コンプリートする問題を全パターン試す
    # 足りない分があれば解いてない最高点数の問題で埋める
    ans = sum([i[0] for i in pc])
    for i in range(2 ** D):
        score = 0
        num = 0
        not_completed_max = -1
        for j in range(D):
            if i >> j & 1:
                score += pc[j][0] * (j + 1) * 100  + pc[j][1]
                num += pc[j][0]
            else:
                not_completed_max = max(j, not_completed_max)
        if score >= G:
            ans = min(num, ans)
        elif (G - score) // ((not_completed_max + 1) * 100) <= pc[not_completed_max][0]:
            ans = min(num + (G - score - 1) // ((not_completed_max + 1) * 100) + 1, ans)

    print(ans)

def __starting_point():
    resolve()

__starting_point()

#
# abc104 c
#
import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2 700
3 500
5 800"""
        output = """3"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2 2000
3 500
5 800"""
        output = """7"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """2 400
3 500
5 800"""
        output = """2"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """5 25000
20 1000
40 1000
50 1000
30 1000
1 1000"""
        output = """66"""
        self.assertIO(input, output)


def resolve():
    D, G = list(map(int, input().split()))
    PC = [list(map(int, input().split())) for _ in range(D)]

    ans = float("inf")
    for bit in range(1 << D):
        s = 0
        c = 0
        un = set(range(D))
        for i in range(D):
            if bit & 1 << i:
                s += 100*(i+1)*PC[i][0] + PC[i][1]
                c += PC[i][0]
                un.discard(i)

        if s >= G:
            ans = min(ans, c)
        else:
            u = max(un)
            for i in range(1, PC[u][0]):
                if s+(u+1)*100*i >= G:
                    c += i
                    break
            else:
                continue
            ans = min(ans, c)

    print(ans)


def __starting_point():
    # unittest.main()
    resolve()

__starting_point()

# 未知のアルゴリズムか天才系DPかと思ってすぐ諦めて解説読んでしまった

d, g = list(map(int, input().split()))
points = []
for _ in range(d):
    p, c = list(map(int, input().split()))
    points.append((p, c))
ans = 10**12
for bit in range(2**d):
    arr = [False] * d
    for i in range(d):
        if bit >> i & 1 == 1:
            arr[i] = True
    tmp_sum = 0
    count = 0
    for i in range(d):
        if arr[i]:
            # kompuli-to
            tmp_sum += points[i][1]
            tmp_sum += (i + 1) * 100 * points[i][0]
            count += points[i][0]
    if tmp_sum < g:
        # 達成できるまで得点の高いやつからやっていく
        for i in range(d - 1, -1, -1):
            if arr[i]:
                # すでにkompuli-toしてるので
                continue
            used = 0
            for j in range(points[i][0]):
                if tmp_sum < g:
                    tmp_sum += (i + 1) * 100
                    count += 1
                    used += 1
            if used == points[i][0]:
                tmp_sum += points[i][1]
            if tmp_sum >= g:
                break
    ans = min(ans, count)
print(ans)


D, G = list(map(int, input().split()))
pc = [list(map(int, input().split())) for i in range(D)]

ans = float("inf")

for bit in range(1 << D):
    count = 0
    sum = 0
    rest = list(range(1, D+1))

    for i in range(D):
        if bit & (1 << i):
            sum += (i + 1) * pc[i][0] * 100 + pc[i][1]
            count += pc[i][0]
            rest.remove(i + 1)

    if sum < G:
        max_num = max(rest)
        n = min(pc[max_num - 1][0], -(-(G - sum) // (max_num * 100)))
        count += n
        sum += n * max_num * 100

    if sum >= G:
        ans = min(ans, count)

print(ans)


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

ans = float('inf')
for i in range(2**d):
    score = 0
    cnt = 0
    check = [0]*d
    for j in range(d):
        if (i>>j) & 1:
            check[j] = 1
            score += (j+1)*100*pc[j][0] + pc[j][1]
            cnt += pc[j][0]
    j = d-1
    while score < g and j >=0:
        if check[j] == 0:
            n = min(pc[j][0], -(-(g-score) // ((j+1)*100)))
            score += n*(j+1)*100
            cnt += n
        j -= 1
    if score >= g:
        ans = min(ans, cnt)
print(ans)

from itertools import product
import math
D, G = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(D)]

ans = []

for lst in product([0, 1], repeat=D):
    temp = 0
    cnt = 0
    max0 = -1
    p = 0
    for i, j in enumerate(lst):
        temp += (pc[i][0] * 100 * (i+1) + pc[i][1]) * j
        cnt += pc[i][0] * j
        if j == 0 and max0 < i: max0 = i
    if temp < G and max0 != -1:
        p = math.ceil((G - temp)/(100 * (max0 + 1)))
        if p < pc[max0][0]:
            cnt += p
            temp += p * 100 * (max0 + 1)
    if temp >= G: ans.append(cnt)

print(min(ans))

import math

D, G = list(map(int, input().split()))
pc = [list(map(int, input().split())) for i in range(D)]

ans = float("inf")

for bit in range(1 << D):
    count = 0
    sum = 0
    rest = list(range(1, D+1))

    for i in range(D):
        if bit & (1 << i):
            sum += (i + 1) * pc[i][0] * 100 + pc[i][1]
            count += pc[i][0]
            rest.remove(i + 1)

    if sum < G:
        max_num = max(rest)
        n = min(pc[max_num - 1][0], math.ceil((G - sum) / (max_num * 100)))
        count += n
        sum += n * max_num * 100

    if sum >= G:
        ans = min(ans, count)

print(ans)


#!/usr/bin/env python3

import math
# スペース区切りの整数の入力
d, g = list(map(int, input().split()))
#配列の入力
data = [list(map(int, input().split())) for _ in range(d)]
sn=1000

for i in range(2**d):
    ts = [False]*d
    score = 0
    tmp_sn = 0
    flg = True
    for j in range(d):
        if (i>>j)&1:
            ts[j] = True
            score += data[j][0]*100*(j+1)+data[j][1]
            tmp_sn += data[j][0]


    if score < g:
        for k in reversed(list(range(len(ts)))):
            if  ts[k] == False:
                need = g - score
                s1 = (k+1) * 100
                nnum = math.ceil(need / s1)
                if nnum < data[k][0]:
                    tmp_sn += nnum
                    break
                else:
                    flg = False
                    break

    if flg == True and sn > tmp_sn:
        sn = tmp_sn

print(sn)








import math
d,g=map(int,input().split())
p=[list(map(int,input().split())) for _ in range(d)]
ans=sum([i[0] for i in p])
for i in range(2**d-1):
    bit=bin(i)[2:].zfill(d)
    c,s,a=0,0,0
    for j in range(d):
        if bit[j]=='1':
            c+=p[j][0]
            s+=p[j][1]+100*(j+1)*p[j][0]
        else:
            a=max(a,j)
    short=g-s
    pc=max(math.ceil(short/((a+1)*100)),0)
    if pc<p[a][0]:
        ans=min(c+pc,ans)
print(ans)

D,G=map(int,input().split())
pc=[list(map(int,input().split())) for i in range(D)]
ans=G // 100

for i in range(2**D):
    score=0
    b=0
    cnt=0
    for j in range(D):
        if ((i>>j)&1):
            score+=100*(j+1)*pc[j][0]+pc[j][1]
            cnt+=pc[j][0]
        else:
            b=j
    for k in range(pc[b][0]):
        if score>=G and cnt<ans:
            ans=cnt
        score+=(b+1)*100
        cnt+=1
print(ans)

d, gl = map(int, input().split())
p = []
g = []
for i in range(d):
  P,G = map(int, input().split())
  p.append(P)
  g.append(G)
ans = sum(p)
for i in range(1<<d):
  tmp = 0
  c = 0
  b = [0 for i in range(d)]
  for j in range(d):
    if i&(1<<j):
      tmp += g[j] + (j+1)*p[j]*100
      c += p[j]
      b[j] = 1
  s = d-1
  while tmp < gl and s >= 0:
    if b[s] == 1:
      s -= 1
    else:
      for k in range(p[s]):
        tmp += 100*(s+1)
        c += 1
        if tmp >= gl:
          break
      s -= 1
  ans = min(ans,c)
print (ans)

import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()

def main():
    D, G = NMI()
    pc = [NLI() for _ in range(D)]
    ans = 1000
    
    bit_len = D
    for i in range(2**bit_len):
        ls = [0 for _ in range(bit_len)]
        for j in range(bit_len):
            if (i >> j) & 1:
                ls[j] = 1
        
        point = 0
        solved = 0
        half_way = ""
        
        for n in range(D):
            if ls[n] == 1:
                solved += pc[n][0]
                point += pc[n][0]*100*(n+1) +pc[n][1]
            else:
                half_way = n
        
        if G > point:
            if half_way != "":
                remain = int(math.ceil((G-point)/((half_way+1)*100)))
                if remain <pc[half_way][0]:
                    solved += remain
                    ans = min(ans,solved)
        else:
            ans = min(ans,solved)
        
    print(ans)


def __starting_point():
    main()
__starting_point()

import copy
import heapq

from typing import List, Tuple


def main():
    d, g = list(map(int, input().split()))
    v = []
    for _ in range(d):
        p, c = list(map(int, input().split()))
        v.append((p, c))

    print((ag(v, g)))


def ag(v: List[Tuple[int, int]], g: int) -> int:
    rs = []
    # ex. [(3, 500), (5, 800)] -> [(1, 3, 500), (2, 5, 800)]
    v = [(i, p, c) for i, (p, c) in enumerate(v, 1)]

    for j in range(2 ** len(v)):
        cb = []
        for k in range(len(v)):
            if ((j >> k) & 1):
                cb.append(v[k])

        sc = 0
        cnt = 0
        # calc bonus score
        for (i, p, c) in cb:
            sc += i * 100 * p + c
            cnt += p

        vv = [x for x in copy.copy(v) if not x in cb]
        while sc < g:
            if not vv:
                break
            i, p, _ = vv.pop()
            for _ in range(p - 1):
                if sc >= g:
                    break
                sc += i * 100
                cnt += 1

        if sc >= g:
            heapq.heappush(rs, cnt)
    return heapq.heappop(rs)


def __starting_point():
    main()

__starting_point()

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]
 
ans = float("inf")
 
for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))
 
    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)
 
    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100
 
    if sum >= g:
        ans = min(ans, count)
 
print(ans)

D,G=map(int,input().split())
p=[0]*D
c=[0]*D
for i in range(D):
    p[i],c[i]=map(int,input().split())

ans=1000
for i in range(2 ** D):
    op = ["-"] * D
    for j in range(D):
        if ((i >> j) & 1):
            op[D - 1 - j] = "+"
    s=0
    cnt=0
    for j in range(D):
        if op[j]=="+":
            s+=100*(j+1)*p[j]
            s+=c[j]
            cnt+=p[j]
    if s<G:
        for j in range(D-1,-1,-1):
            if op[j]=="-":
                for k in range(p[j]):
                    if s>=G:
                        break
                    s+=100*(j+1)
                    cnt+=1
    ans=min(cnt,ans)

print(ans)

def dsf(i,sum,count,nokori):
    nonlocal ans
    # 階層が最下層になった時
    if i == d:
        #sumは絶対答えではない
        if sum < g:
            use = max(nokori)
            n = min(pc[use - 1][0],-(-(g - sum) // (100 * use)))
            count += n
            sum += n * use * 100



        # sumは答えになる可能性あり
        if sum >= g:
            ans = min(ans,count)
    else:
        #問題を解かないパターン
        dsf(i+1,sum,count,nokori)
        #問題を解くパターン(階層、合計+最大のボーナス、現在の合計の数+最大の数、残りの問題を管理)
        dsf(i + 1,sum + pc[i][0] * (i + 1) * 100 + pc[i][1],count + pc[i][0],nokori - {i + 1})
# 解く問題ととかない問題
d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]
ans = float('inf')

#階層、合計、現在の合計の数、残りの問題を管理
dsf(0,0,0,set(range(1,d + 1)))
print(ans)

from itertools import product

D, G = map(int, input().split())
G //= 100
prob = []

for i in range(1, D+1):
  p, c = map(int, input().split())
  prob.append((i, p, c//100))

ans = 1000
for comp in product((0, 1), repeat=D):
  cnt, score = 0, 0
  for i, c in enumerate(comp):
    if c:
      cnt += prob[i][1]
      score += prob[i][0]*prob[i][1] + prob[i][2]
  j = D-1
  while score < G and j >= 0:
    if comp[j] == 0:
      if score + prob[j][0]*prob[j][1] <= G:
        cnt += prob[j][1]
        score += prob[j][0]*prob[j][1]
      else:
        temp = -(-(G - score)//prob[j][0])
        cnt += temp
        score += prob[j][0]*temp
    j -= 1
  ans = min(ans, cnt)

print(ans)

def dfs(i, sum, count, nokori):
    nonlocal ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)

D, G = map(int, input().split())

P = []
C = []
for _ in range(D):
  p, c = map(int, input().split())
  P.append(p)
  C.append(c)

ans = []
for bit in range(1<<D):
  total_score = 0
  solved = 0
  for i in range(D):
    if bit & (1<<i):
      total_score += C[i] + ((i+1)*100) * P[i]
      solved += P[i]

  for i in range(D - 1, -1, -1):
    if G <= total_score:
      ans.append(solved)
      break
      
    if bit & (1<<i):
      continue
      
    s = (i+1) * 100
    required_score = G - total_score
    required_problem = (required_score + s - 1) // s
    total_score += min(required_problem, P[i]-1) * s
    solved += min(required_problem, P[i]-1)

    if G <= total_score:
      ans.append(solved)
    
    break
    
print(min(ans))

d, g = map(int, input().split())
pc = [list(map(int,input().split())) for _ in range(d)]
ans = g//100 + 1

for i in range(2**d):
    count = 0
    total = 0
    for j in range(d):
        if (i >> j) & 1 == 1:
            count += pc[j][0]
            total += (j+1)*100*pc[j][0] + pc[j][1]

    if total >= g:
        ans = min(ans, count)
    else:
        for k in reversed(range(d)):
            if ((i >> k) & 1) == 0:
                for _ in range(pc[k][0]-1):
                    count += 1
                    total += (k+1)*100
                    if total >= g:
                        ans = min(ans, count)
                        break

print(ans)

# まだ解いてない配点を nokori として持つ
def dfs(i, sum, count, nokori):
    nonlocal ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)

d, g = map(int, input().split())
point = [[int(x) for x in input().split()] for i in range(d)]

ans = 100000000
for i in range(2**d):
  sub = 0
  count = 0
  complete = [False]*d
  for j in range(d):
    if (i>>j)&1:
      complete[j] = True
      sub += 100*(j+1)*point[j][0]+point[j][1]
      count += point[j][0]
  for j in range(d-1, -1, -1):
    if sub >= g:
      break
    if complete[j]:
      continue
    c = min((g-sub-1)//(100*(j+1))+1, point[j][0])
    count += c
    sub += c*100*(j+1)
    if c == point[j][0]:
      sub += point[j][1]
  if ans > count:
    ans = count

print(ans)

d, g = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for i in range(d)]
def dfs(ind,score):
  if ind == 0:
    return float("inf")
  cnt = min(score//(ind*100),pc[ind][0])
  add_sc = cnt*(ind*100)
  if cnt == pc[ind][0]:
    add_sc += pc[ind][1]
  if add_sc < score:
    cnt += dfs(ind-1,score-add_sc)
  return min(cnt,dfs(ind-1,score))

print(dfs(d,g))

d,G = map(int,input().split())
g = G//100
plist = [list() for _ in range(d)]
pp = []
pe = []
for i in range(d):
    p,C = map(int,input().split())
    c = C//100
    pp += [p]
    if p==1:
        pe += [i]
    plist[i] += [i+1]*(p-1)
    plist[i] += [i+1+c]

poli = [list() for _ in range(d)]
for i in range(d):
    poli[i] += [plist[i][0]]
    for j in range(pp[i]-1):
        poli[i] += [poli[i][j]+plist[i][j+1]]

import math
numli = []
for i in range(2**d):
    kari = 0
    nkanli = []
    karimon = 0
    for j in range(d):
        if (i>>j)&1 == 1:
            kari += poli[j][-1]
            karimon += pp[j]
        else:
            nkanli +=[j]
    if kari>=g:
        numli += [karimon]
    else:
        if nkanli == []:
            continue
        else:
            for k in range(len(nkanli)-1,-1,-1):
                if nkanli[k] in pe:
                    continue
                else:
                    if kari + poli[nkanli[k]][-2]>=g:
                        karimon += math.ceil((g-kari)/(nkanli[k]+1))
                        numli += [karimon]
                        break
                    else:
                        break
    #print(kari,nkanli,karimon)
#print(numli)
print(min(numli))

from math import ceil

d,g = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(d)]

ans = float("inf")
for bit in range(1<<d):
    sum = 0
    cnt = 0
    #残ってるやつのmaxのインデックス取得するためsetを設定
    nokori = set(range(1, d + 1))
    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0]*100*(i+1) + pc[i][1]
            cnt += pc[i][0]
            nokori.discard(i+1)
    
    if sum < g:
        use = max(nokori)
        husoku = min(ceil((g-sum)/(use*100)),pc[use-1][0])
        cnt += husoku
        sum += husoku*use*100
    
    if sum >= g:
        ans = min(cnt,ans)

print(ans)

# -*- coding: utf-8 -*-
D, G = list(map(int, input().split()))
data = [list(map(int, input().split())) for i in range(D)]
ps, cs = list(zip(*data))
clear_cnt = D
min_prb = 1000
for i in range(1 << D):
    result = 0
    num_prb = 0
    not_selected_list = list()
    for j in range(D):
        if (i >> j & 1):
            result += ps[j] * 100 * (j+1) + cs[j]
            num_prb += ps[j]
        else:
            not_selected_list.append(j)
    if result < G:
        not_selected = max(not_selected_list)
        add_num_prb = min(ps[not_selected], -(-(G - result)//(100*(not_selected+1))) )
        num_prb += add_num_prb
        result += add_num_prb * (not_selected+1) * 100
    if result >= G:
        min_prb = min(min_prb, num_prb)
print((int(min_prb)))


d,g = map(int, input().split())
pc = list(list(map(int,input().split())) for _ in range(d))
ans = float("inf")
          
for i in range(1<<d):
    count = 0
    sum = 0
    nokori = set(range(1, d+1))
    
    # ボーナスをもらえる解答のみでスコアを計算
    for j in range(d):
        if i & 1<<j:
            sum += pc[j][0]*(j+1)*100+pc[j][1]
            count += pc[j][0]
            nokori.discard(j+1)
            
    # スコアがG点に届かない場合
    if sum < g:
        use = max(nokori)
        n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
        count += n
        sum += n*use*100
        
    # スコアがG点に届いた場合
    if sum >= g:
        ans = min(ans, count)
print(ans)

d, g = map(int, input().split())
dp = [0 for i in range(1001)]
dp[0] = 0
num = 0
for i in range(1, d + 1):
    p, c = map(int, input().split())
    for j in range(num, -1, -1):
        for k in range(1, p + 1):
            if k != p:
                dp[j + k] = max(dp[j + k], dp[j] + 100 * i * k)
            else:
                dp[j + k] = max(dp[j + k], dp[j] + 100 * i * k + c)
    num += p
for i in range(1001):
    if dp[i] >= g:
        print(i)
        break

D, G = map(int, input().split())
problem = [list(map(int, input().split())) for _ in range(D)]

ans = 10**15
for i in range(2**D):
    score = 0
    prob = 0
    lst = []
    for j in range(D):
        if((i >> j) & 1):
            score += (j+1)*100*problem[j][0]+problem[j][1]
            prob += problem[j][0]
        else:
            lst.append(j)
            
            
    if(score < G):
        r = lst[-1]
        for _ in range(problem[r][0]-1):
            score += 100*(r+1)
            prob += 1
            if(score >= G):
                break
        
    if(score >= G):
        ans = min(ans, prob)
            
print(ans)

d,g=map(int,input().split())
p=[]
c=[]
for i in range(d):
    P,C=map(int,input().split())
    p.append(P)
    c.append(C)
ans=sum(p)
for i in range(2**d):
    z=i
    x=[]
    for j in range(d):
        x.append(z%2)
        z=z//2
    po=0
    m=0
    for j in range(d):
        if x[j]==1:
            po+=100*(j+1)*p[j]+c[j]
            m+=p[j]
    q=[[] for j in range(d)] #残りp、c
    s=0
    for j in range(d):
        if x[j]==0:
            q[s].append(100*(j+1))
            q[s].append(p[j])
            s+=1
    q=[q[j] for j in range(d) if q[j]!=[]]
    q=sorted(q,reverse=True)
    w=len(q)
    for j in range(w):
        q[j][1]-=1
    if po>=g:
        ans=min(ans,m)
    else:
        for j in range(w):
            if po+q[j][0]*q[j][1]>=g:
                m+=(g-po+q[j][0]-1)//q[j][0]
                ans=min(ans,m)
                break
            else:
                po+=q[j][0]*q[j][1]
                m+=q[j][1]
print(ans)

d, g = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for i in range(d)]
def dfs(d_, g_):
    if d_ == 0:
        return float("inf")
    cnt = min(g_ // (d_ * 100), pc[d_][0])
    cur = cnt * 100 * d_
    if cnt == pc[d_][0]:
        cur += pc[d_][1]
    if g_ > cur:
        cnt += dfs(d_ - 1, g_ - cur)
    return min(cnt, dfs(d_ - 1, g_))
print(dfs(d, g))

import math

D, G = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(D)]

ans = float("inf")

for bit in range(1 << D):
    cnt = 0
    sum = 0
    pids = set(range(D))

    for i in range(D):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            cnt += pc[i][0]
            pids.discard(i)

    if sum < G:
        pid = max(pids)
        n = min(pc[pid][0], math.ceil((G - sum) / ((pid + 1) * 100)))
        cnt += n
        sum += n * (pid + 1) * 100
        
    if sum >= G:
        ans = min(ans, cnt)

print(ans)

d, g = map(int, input().split())
pc = [list(map(int,input().split())) for _ in range(d)]
ans = g//100 + 1

for i in range(2**d):
    count = 0
    total = 0
    for j in range(d):
        if (i >> j) & 1 == 1:
            count += pc[j][0]
            total += (j+1)*100*pc[j][0] + pc[j][1]

    if total >= g:
        ans = min(ans, count)
    else:
        for k in reversed(range(d)):
            if ((i >> k) & 1) == 0:
                for _ in range(pc[k][0]):
                    if total >= g:
                        ans = min(ans, count)
                        break
                    count += 1
                    total += (k+1)*100

print(ans)

from math import ceil

D, G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        n = min(pc[use-1][0], ceil((G-sum)/(use*100)))
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

from collections import defaultdict

def main():
    D, G = map(int, input().split())
    problem = []
    for _ in range(D):
        p, c = map(int, input().split())
        problem.append([p,c])
    ans = float('inf')
    for i in range(2**D):
        all_solve = []
        others = []
        score = 0
        cnt = 0
        for j in range(D):
            if (i >> j) & 1:
                all_solve.append(j)
                cnt += problem[j][0]
                score += 100 * (j+1) * problem[j][0] + problem[j][1]
            else:
                others.append(j)
        if score >= G:
            ans = min(cnt,ans)
            continue

        others.sort(reverse=True)
        for k in others:
            for m in range(problem[k][0]):
                score += 100*(k+1)
                cnt += 1
                if score >= G:
                    ans = min(ans, cnt)
                    break
            else:
                score += problem[k][1]
                if score >= G:
                    ans = min(ans, cnt)
            if score >= G:
                break
        
        if score >= G:
            ans = min(ans, cnt)

        
    print(ans)    

def __starting_point():
    main()
__starting_point()

import itertools
from typing import List, Tuple
 
 
def main():
    d, g = list(map(int, input().split()))
    v = []
    for _ in range(d):
        p, c = list(map(int, input().split()))
        v.append((p, c))
 
    print((ag(v, g)))
 
 
def ag(v: List[Tuple[int, int]], g: int) -> int:
    ret = 10 ** 10
    for comb in itertools.product((False, True), repeat=len(v)):
        cnt, score = 0, 0
        for i, bit in enumerate(comb):
            if bit:
                score += (i + 1) * 100 * v[i][0] + v[i][1]
                cnt += v[i][0]
        if score < g:
            idx = len(v) - list(reversed(comb)).index(False) - 1
            add = ((g - score) + ((idx + 1) * 100) - 1) // ((idx + 1) * 100)
            if add < v[idx][0]:
                cnt += add
            else:
                cnt = 10 ** 10  # impossible
        ret = min(ret, cnt)
    return ret
 
 
def __starting_point():
    main()

__starting_point()

import sys
sys.setrecursionlimit(10 ** 6)

D,G=map(int,input().split())
pc=[list(map(int,input().split())) for _ in range(D)]

def solve(bit):
  if bit >= (1<<D):
    return 1000
  p_sum=0
  num=0
  
  for i in range(D):
    if bit & (1<<i):
      p_sum += pc[i][1] + pc[i][0] * 100*(i+1)
      num += pc[i][0]
  if p_sum >= G:
    return min(num,solve(bit+1))
  else:
    for i in reversed(range(D)):
      if bit & 1<<i:
        continue
      for j in range(pc[i][0]):
        if p_sum >= G:
          break
        p_sum += 100*(i+1)
        num += 1
      else:
        return solve(bit+1)
    return min(num,solve(bit+1))

print(solve(0))

d,g=map(int,input().split())
g//=100
A=[]
for i in range(d):
    p,c=map(int,input().split())
    c//=100
    A.append([i+1, p, c])
ans=float("inf")
# print(A)
for bit in range(1<<d):
    now=0 ; mon=0
    for i in range(d):
        if bit>>i &1:
            now+=A[i][0]*A[i][1]+A[i][2]
            mon+=A[i][1]
    # print(bit,now,mon)
    if now>=g:
        ans=min(ans,mon)
        continue
        
    for i in range(d-1,-1,-1):
        if bit>>i &1==0:
            for j in range(A[i][1]): #余りに何問とくか
                now+=A[i][0] ; mon+=1
                if now>=g:
                    ans=min(ans,mon)
                    continue
                else:
                    continue
print(ans)

# coding: utf-8
# Your code here!
from itertools import product

ans = 10**9

D, G=list(map(int, input().split())) 
problem=[list(map(int,list(input().split()))) for i in range(D)]

for p in product([True, False], repeat=D):
    
    point = 0
    num = 0
    
    for i in range(D):
        if p[i]:
            point += (i+1) * 100 * problem[i][0] + problem[i][1]
            num += problem[i][0]
            
    if point >= G:
        ans = min(ans, num)
    
    for i in reversed(list(range(D))):
        if p[i] == False:
            if point >= G:
                ans = min(ans, num)
                break
            for j in range(problem[i][0]):
                point += (i+1) * 100
                num += 1
                if point >= G:
                    break
    if point >= G:
        ans = min(ans, num)
print(ans)



D, G = map(int,input().split())
table = []
ans = 0

for i in range(D):
    p,c = map(int,input().split())
    ans += p
    table.append((p,c))


for i in range(2**D):
    score = 0
    n = 0
    solved = [0] * D
    for j in range(D):
        if i>>j & 1:
            p,c = table[j]
            solved[j] = 1
            score += 100*(j+1)*p+c
            n += p
    if score<G:
        for k in range(D-1,-1,-1):
            if solved[k] == 0:
                p = table[k][0]
                for l in range(1,p):
                    score += 100*(k+1)
                    n += 1
                    if score>=G:
                        break
                break

    if score>=G:
        ans = min(n,ans)
print(ans)

def cal():
    d, g = list(map(int, input().split()))
    a = [list(map(int, input().split())) for i in range(d)]
    ans = float('inf')

    for i in range(2**d):
        b = ['-']*d
        for j in range(d):
            if (i>>j)&1:
                b[j] = '+'
        count0, count1 = 0, 0
        for j in range(d):
            if b[j] == '+':
                count0 += 100*(j+1)*a[j][0]+a[j][1]
                count1 += a[j][0]
        if count0 < g:
            for j in range(d-1, -1, -1):
                if b[j] == '-':
                    for k in range(a[j][0]):
                        if count0 >= g:
                            break
                        count0 += 100*(j+1)
                        count1 += 1
        ans = min(ans, count1)
    print(ans)
cal()


from itertools import product

d, g = list(map(int, input().split()))
g //= 100
p, c = [], []
for _ in range(d):
    i, j = list(map(int, input().split()))
    p.append(i)
    c.append(j // 100)

# full search about complete bonuses
ans = sum(p)
for tf in product([True, False], repeat=d):
    score = 0
    cnt = 0

    for ind in range(d):
        if tf[ind]:
            cnt += p[ind]
            score += (ind + 1) * p[ind] + c[ind]
    
    for ind in range(d-1, -1, -1):
        if score >= g:
            break

        if tf[ind]:
            continue
        
        if (ind + 1) * p[ind] + score <= g:
            cnt += p[ind]
            score += (ind + 1) * p[ind]
        else:
            cnt += (g - score - 1) // (ind + 1) + 1
            score = g
    
    if score >= g and ans > cnt:
        ans = cnt

print(ans)


d,g = map(int,input().split())
pc = list(list(map(int, input().split())) for _ in range(d))
ans = float("inf")

for i in range(1<<d):
    score = 0
    cnt = 0
    nokori = set(range(1, d+1))
    
    for j in range(d):
        if i>>j &1:
            score += (j+1)*pc[j][0]*100+pc[j][1]
            cnt += pc[j][0]
            nokori.discard(j+1)
            
    if score < g:
        use = max(nokori)
        n = min(pc[use-1][0], -(-(g-score)//(use*100))) # (g-sum)//(use*100)＞0
        cnt += n
        score += n*use*100
    if score >= g:
        ans = min(ans, cnt)
print(ans)

import math
d,g = list(map(int,input().split()))
prob = []
for i in range(d):
  p,c = list(map(int,input().split()))
  prob.append([p,c,p*(i+1)*100+c])
  
mindays = 10**9
for i in range(2**d):
  point = 0
  days = 0
  one = []
  for j in range(d):
    if ((i>>j)&1)==0:
      point += prob[j][2]
      days += prob[j][0]
    else:
      one.append(j+1)
  if point>=g:
    mindays = min(mindays,days)
  elif point<g:
    for k in range(len(one)):
        day =days
        tmp = math.ceil((g-point)/(one[k]*100))
        if tmp<=prob[one[-1]-1][0]:
          day += tmp
          mindays = min(mindays,day)
print(mindays)


#!/usr/bin/env python3
import itertools
import math

d, g = list(map(int, input().split()))
pc = [list(map(int, input().split())) for i in range(d)]


ans = 100*d*100
for d in itertools.product([0, 1], repeat=d):
    ans_tmp = 0
    value = 0

    for i, j in enumerate(d):
        if j == 0:
            continue
        ans_tmp += pc[i][0]
        value += (i+1)*100*pc[i][0] + pc[i][1]

    iter_ = [[i, j] for i, j in enumerate(d)]
    # print(iter_)
    for i, j in reversed(iter_):
        if j == 1:
            continue
        base = (i+1)*100

        shortage = g-value
        if g-value <= 0:
            break

        num = min(math.ceil(shortage/base), pc[i][0]-1)
        ans_tmp += num
        value += base*num
    # print(d)
    # print(value, ans_tmp)
    if value >= g:
        ans = min(ans, ans_tmp)

print(ans)


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

ans = 100*11
for i in range(2**d):
    sum = 0
    cnt = 0
    a = []
    for j in range(d):
        if (i >> j) & 1 == 1:
            sum += (j+1)*100*pc[j][0] + pc[j][1]
            cnt += pc[j][0]
            a.append(j)
    if sum < g:
        for j in range(d):
            if d-j-1 not in a:
                for k in range(pc[d-j-1][0]):
                    if sum >= g:
                        break
                    sum += (d-j)*100
                    cnt += 1
    ans = min(ans, cnt)
print(ans)

d,g = map(int,input().split())
p,c = [],[]
ans = 1<<32
for i in range(d):
    x,y = map(int,input().split())
    p.append(x)
    c.append(y)
for i in range(1<<d):
    cnt = 0
    tmp = 0
    for j in range(d):
        if i&(1<<j):
            tmp+=(j+1)*100*p[j]+c[j]
            cnt+=p[j]
    if tmp<g:
        for j in range(d-1,-1,-1):
            if i&(1<<j)==0:
                for k in range(p[j]):
                    if tmp>=g:
                        break
                    tmp+=(j+1)*100
                    cnt+=1
                else:
                    tmp+=c[j]
    ans = min(cnt,ans)
print(ans)

d,g=map(int,input().split())
T=[]
for _ in range(d):
  p,c=map(int,input().split())
  T.append([p,c])

ans=float('inf')
for i in range(1<<d):
  Q=[]
  cnt=0
  score=0
  for j in range(d):
    if (i>>j)&1:
      Q.append(j)
  for v in Q:
    score+=100*(v+1)*(T[v][0])+T[v][1]
    cnt+=T[v][0]
  if score>=g:
    ans=min(ans,cnt)
  else:
    for i in range(d-1,-1,-1):
      if i in Q:
        continue
      if score>=g:
        continue
      rest=T[i][0]
      while rest:
        if score>=g:
          break
        score+=100*(i+1)
        rest-=1
        cnt+=1
    ans=min(ans,cnt)
print(ans)      

# -*- coding: utf-8 -*-
# モジュールのインポート
import math

# 標準入力を取得
D, G = list(map(int, input().split()))
p, c = [], []
for i in range(D):
    p_i, c_i = list(map(int, input().split()))
    p.append(p_i)
    c.append(c_i)

# 求解処理
ans = sum(p)
for bit in range(2 << D):
    d = 0
    cnt = 0
    score = 0
    for i in range(D):
        if (bit >> i) & 1:
            cnt += p[i]
            score += 100 * (i + 1) * p[i] + c[i]
        else:
            d = i
    if score < G:
        cnt_d = min(math.ceil((G - score) / (100 * (d + 1))), p[d] - 1)
        cnt += cnt_d
        score += 100 * (d + 1) * cnt_d

    if score >= G:
        ans = min(ans, cnt)

# 結果出力
print(ans)


D,G = list(map(int,input().split()))
pc = []
for i in range(D):
    pc.append(list(map(int,input().split())))

scoreList = [0 for i in range(D)]

for i in range(D):
    scoreList[i] = (i + 1) * 100 * pc[i][0] + pc[i][1]

choiceList = [[] for i in range(2 ** D)]
for i in range(2 ** D):
    for j in range(D):
        choiceList[i].append(i // (2 ** j) % 2)

minCount = 10 ** 8
for choice in choiceList:
    score = 0
    count = 0
    for i in range(len(choice)):
        if choice[i] == 1:
            score += scoreList[i]
            count += pc[i][0]
    for j in range(D):
        countTmp = count
        extraScore = (j + 1) * 100 * pc[j][0]
        delta = G - score
        if delta < 0:
            countTmp = count
        elif delta == 0:
            countTmp = count
        elif delta > 0:
            if delta <= extraScore and choice[j] == 0:
                countTmp += delta // ((j + 1) * 100)
                if delta % ((j + 1) * 100) > 0:
                    countTmp += 1
            else:
                countTmp = 10 ** 8
        if countTmp < minCount:
            minCount = countTmp
print(minCount)

# まだ解いてない配点を nokori として持つ
def dfs(i, sum, count, nokori):
    nonlocal ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    D, G, *PC = list(map(int, read().split()))
    P = PC[::2]
    C = PC[1::2]

    ans = INF
    for mask in range(1 << D):
        problems = score = 0
        for i in range(D):
            if mask & (1 << i):
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                idx_max = i

        if score >= G:
            if ans > problems:
                ans = problems
            continue

        if score + 100 * (idx_max + 1) * (P[idx_max] - 1) >= G:
            problems += (G - score + 100 * (idx_max + 1) - 1) // (100 * (idx_max + 1))
            if ans > problems:
                ans = problems

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
# 
# 
# @stop_watch
def solve(D, G, pc):
    point_map = []
    point_sum = []
    for i in range(D):
        p, c = pc[i]
        tmp = [100 * (i + 1)] * p
        tmp[-1] += c
        point_map.append(tmp)
        point_sum.append(sum(tmp))

    ans = 100 * 11
    for i in range(2 ** D):
        count = 0
        point = 0
        other_problems = []
        for j in range(D):
            if i >> j & 1:
                count += pc[j][0]
                point += point_sum[j]
            else:
                other_problems = point_map[j][:-1] + other_problems
        if point < G:
            for op in other_problems:
                count += 1
                point += op
                if point >= G:
                    break
        if point >= G:
            ans = min(ans, count)
    print(ans)


def __starting_point():
    D, G = list(map(int, input().split()))
    pc = [[int(i) for i in input().split()] for _ in range(D)]
    solve(D, G, pc)

    # # test
    # from random import randint
    # from func import random_str
    # solve()

__starting_point()

d,g = map(int,input().split())
p,c = [],[]
ans = float('inf')
for i in range(d):
    x,y = map(int,input().split())
    p.append(x)
    c.append(y)
for i in range((1<<d)):
    tmp,cnt = 0,0
    for j in range(d):
        if i&(1<<j):
            tmp = tmp + 100*(j+1)*p[j]+c[j]
            cnt += p[j]
    if tmp>=g:
        if cnt<ans: ans=cnt
    else:
        for j in range(d-1,-1,-1):
            if i&(1<<j): continue
            for k in range(p[j]):
                if tmp>=g: break
                tmp = tmp + 100*(j+1)
                cnt+=1
        if cnt<ans: ans = cnt
print(ans)

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    D, G, *PC = list(map(int, read().split()))
    P = PC[::2]
    C = PC[1::2]

    ans = INF
    for mask in range(1 << D):
        problems = score = 0
        available = [False] * D
        for i in range(D):
            if mask & (1 << i):
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                available[i] = True

        if score >= G:
            if ans > problems:
                ans = problems
            continue

        for i in range(D - 1, -1, -1):
            if not available[i]:
                continue
            if score + 100 * (i + 1) * P[i] + C[i] < G:
                problems += P[i]
                score += 100 * (i + 1) * P[i] + C[i]
            else:
                n = (G - score + 100 * (i + 1) - 1) // (100 * (i + 1))
                problems += n
                score += 100 * (i + 1) * n
                break

        if score >= G and ans > problems:
            ans = problems

    print(ans)
    return


def __starting_point():
    main()

__starting_point()

#!/usr/bin/env python3
import sys


def solve(D: int, G: int, p: "List[int]", c: "List[int]"):
    from itertools import product, compress
    from math import ceil
    def f():
        for selectors in product([True, False], repeat=D):
            n, g = 0, G
            for i, (pp, cc) in compress(enumerate(zip(p, c), 1), selectors):
                n += pp
                g -= i * 100 * pp + cc
            for i in range(D, 0, -1):
                if selectors[i-1]:
                    continue
                if g <= 0:
                    break
                nn = min(p[i-1], ceil(g / i / 100))
                n += nn
                g -= nn * i * 100
            yield n
    return min(f())
                


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    D = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    p = [int()] * (D)  # type: "List[int]"
    c = [int()] * (D)  # type: "List[int]"
    for i in range(D):
        p[i] = int(next(tokens))
        c[i] = int(next(tokens))
    print((solve(D, G, p, c)))

def test():
    import doctest
    doctest.testmod()

def __starting_point():
    #test()
    main()

__starting_point()

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

d, gl = map(int, input().split())
p = []
g = []
for i in range(d):
  P,G = map(int, input().split())
  p.append(P)
  g.append(G)
ans = sum(p)
for i in range(1<<d):
  tmp = 0
  c = 0
  b = [0 for i in range(d)]
  for j in range(d):
    if i&(1<<j):
      tmp += g[j] + (j+1)*p[j]*100
      c += p[j]
      b[j] = 1
  s = d-1
  while tmp < gl and s >= 0:
    if b[s] == 1:
      s -= 1
    else:
      for k in range(p[s]):
        tmp += 100*(s+1)
        c += 1
        if tmp >= gl:
          break
      s -= 1
  if tmp >= gl:
    ans = min(ans,c)
print (ans)

D, G = map(int, input().split())

P = []
C = []

for i in range(D):
    p,c = map(int,input().split())
    P.append(p)
    C.append(c)

ans = 1000
for i in range(2**D):
    point = 0
    num = 0
    unsolved = []
    for j in range(D):
        if (i >> j)&1 == 1:
            point += 100*(j + 1)*P[j] + C[j]
            num += P[j]
        
        else:
            unsolved.append(j)

    if G <= point:
        ans = min(num, ans)
    
    
    else:
        l = []
        unsolved.reverse()
        for i in unsolved:
            l += [100*(i + 1)]*(P[i] - 1)
        for j in range(len(l)):
            point += l[j]
            num += 1

            if G <= point:
                ans = min(num, ans)
print(ans)

"""
中途半端にとく問題は一種類のみで良い。
全探索で全ての点数帯について、ボーナスをとるか・一問もとかないかで全探索
もし点がGに満たない場合は一番点が高いものを解く。
"""
d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

for bit in range(1 << d):  #2^d通り試す
    count = 0
    sum = 0
    rest = list(range(1, d + 1))  #一問も解いていない点数帯の集合

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            rest.remove(i + 1)

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(rest)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))  ##全部解いても足りないかもしれない。-(-a//b))で切り上げをしている。
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

from itertools import product
max2 = lambda x,y: x if x > y else y
min2 = lambda x,y: x if x < y else y

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

pc = [tuple(map(int,input().split())) for _ in range(D)]
pc = [(p,c,100*i) for i,(p,c) in enumerate(pc, start=1)]
res = sum(p for p,c,k in pc)
for choice in product((True,False),repeat=D):
    t = sum(c+p*k for (p,c,k),f in zip(pc,choice) if f)
    steps = sum(p for (p,c,k),f in zip(pc,choice) if f)

    if t >= G:
        res = min2(res,steps)
        continue

    for (p,c,k),f in zip(reversed(pc), reversed(choice)):
        if not f:
            break

    if p*k+t >= G:
        steps += (G-t-1)//k + 1
        res = min2(res,steps)

print(res)


D, G = map(int,input().split())
pc = [list(map(int,input().split())) for i in range(D)]

ans = float("inf")
for bit in range(1 << D):
    cnt = 0
    sum = 0
    remain = set(range(1,D+1))

    for i in range(D):
        if bit & (1 << i):
            cnt += pc[i][0]
            sum += pc[i][0]*(i+1)*100 + pc[i][1]
            remain.discard(i+1)

    if sum < G:
        use = max(remain)
        n = min(pc[use-1][0],-(-(G - sum)//(use*100)))
        cnt += n
        sum += n*use*100

    if sum >= G:
        ans = min(ans,cnt)

print(ans)

D, G = [int(x) for x in input().split()]
P, C = [], []
for _ in range(D):
    p, c = [int(x) for x in input().split()]
    P.append(p)
    C.append(c)

ans = 1000
for b in range(2**D):
    score = 0
    solve = 0
    unsolved = []
    for i in range(D):
        if (b >> i) & 1:
            score += C[i] + 100 * (i + 1) * P[i]
            solve += P[i]
        else:
            unsolved.append(i)
    if G > score:
        resprbs = []
        unsolved.reverse()
        for i in unsolved:
            resprbs += [100 * (i + 1)] * (P[i] - 1)
        for j in range(len(resprbs)):
            score += resprbs[j]
            solve += 1
            if G <= score:
                break
    if G <= score:
        ans = min(ans, solve)

print(ans)

D,G=map(int,input().split())
G/=100
P=[]
C=[]
for _ in range(D):
    x,y=map(int,input().split())
    P.append(x)
    C.append(y//100)

ans=10**9
for x in range(2**D):
    cost=0
    value=0
    for i in range(D):
        if (x>>i)%2==1:
            value += P[i]*(i+1) + C[i]
            cost += P[i]
    for i in range(D-1,-1,-1):
        if value >= G:
            break
        elif (x>>i)%2==0:
            for _ in range(P[i]-1):
                value += i+1
                cost += 1
                if value>=G:
                    break
    if value>=G:
        ans=min(ans,cost)
print(ans)

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

def completed(ii):
    return(100 * (ii + 1) * pc[ii][0] + pc[ii][1])

def items(gg, ii):
    return((gg + 100 * (ii + 1) - 1) // (100 * (ii + 1)))


count = [0] * (2 ** d)
meet = [1] * (2 ** d)
for i in range(2 ** d):
    score = 0
    cnt = 0
    for j in range(d):
        if (i >> j) & 1 == 1:
            score += completed(j)
            cnt += pc[j][0]

    if score >= g:
        count[i] = cnt
        continue
    
    for j in range(d)[::-1]:
        if (~i >> j) & 1 == 1:
            if items(g - score, j) < pc[j][0]:
                tmp = items(g - score, j)
                cnt += tmp
                score += 100 * (j + 1) * tmp
            else:
                cnt += pc[j][0] - 1
                score += 100 * (j + 1) * (pc[j][0] - 1)
        if score >= g:
            count[i] = cnt
            break

    if score < g:
        count[i] = cnt
        meet[i] = 0

ans = sum([pc[s][0] for s in range(d)])
for i in range(2 ** d):
    if meet[i] == 1:
        ans = min(ans, count[i])
print(ans)

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]

ans = float('inf')

for i in range(1 << d):
  count = 0
  sum = 0
  nokori = set(range(1, d+1))
  
  for j in range(d):
    if i & (1<<j):
      sum += pc[j][0] * (j+1) * 100 + pc[j][1]
      count += pc[j][0]
      nokori.discard(j+1)
      
  if sum < g:
    use = max(nokori)
    n = min(pc[use-1][0], -(-(g-sum)//(use*100)))
    count += n
    sum += n*use*100
    
  if sum >= g:
    ans = min(ans, count)

print(ans)

D, G = map(int, input().split())
PC = [list(map(int, input().split())) for i in range(D)]


points = []
patterns = []
    
def flagfun(flag):
    if len(flag) == D:
        patterns.append(flag)
        return
    
    flagfun(flag+'0')
    flagfun(flag+'1')
    
def index_pattern():
    flagfun('')
    idxes = []
    for pattern in patterns:
        tmp_idx = []
        for idx, flag in enumerate(pattern):
            if flag == '1':
                tmp_idx.append(idx)
        idxes.append(tmp_idx)
    return idxes

def culc_points():
    for i, scores in enumerate(PC):
        max_score = (i+1)*scores[0]*100 + scores[1]
        points.append([scores[0], max_score])

culc_points()

idxes = index_pattern()
count = 1000000

for idx in idxes:
    tmp_count = 0
    tmp_score = 0
    remain_idx = [i for i in range(D)]
    for i in idx:
        tmp_count += points[i][0]
        tmp_score += points[i][1]
        num_index = remain_idx.index(i)
        remain_idx.pop(num_index)
           
    if tmp_count >= count:
        continue
    
    if tmp_score >= G:
        count = tmp_count
        continue
    
    max_idx = remain_idx.pop(-1)
    for i in range(1, points[max_idx][0]):
        tmp_count += 1
        tmp_score +=(max_idx+1)*100
        if tmp_count >= count:
            break
            
        if tmp_score >= G:
            count = tmp_count
            break

print(count)

def main():
	D,G = map(int,input().split())
	ListPC = [list(map(int,input().split())) for d in range(D)]
	ans = sum([i[0] for i in ListPC])

	for i in range(2**D):
		# 点数,正解数,解いてない最高点数idx
		TempPoint,num,restmax = 0,0,-1
		# 全埋め問題加算
		for j in range(D):
			if i>>j & 1:
				TempPoint += 100*(j+1)*ListPC[j][0]+ListPC[j][1]
				num += ListPC[j][0]
			else:
				restmax = max(j,restmax)
		# 合格なら更新
		if TempPoint >= G:
			ans = min(num,ans)
		# 最高問題解いて合格なら更新
		elif (G - TempPoint) // ((restmax + 1) * 100) <= ListPC[restmax][0]:
			ans = min(num + (G - TempPoint - 1) // ((restmax + 1) * 100) + 1, ans)
	print(ans)

def __starting_point():
	main()
__starting_point()

D, G = map(int, input().split())

PC = [list(map(int, input().split())) for _ in range(D)]

ans = 10**9
for bit in range(2**D):
    cnt = 0
    score = 0
    dic = set(range(D))
    for i in range(D):
        if (bit>>i)&1:
            score += PC[i][0] * 100 * (i+1) + PC[i][1]
            cnt += PC[i][0]
            dic.discard(i)

    if score < G:
        t = max(dic)
        p, c = PC[t][0], PC[t][1]
        if (t+1)*100*p+c+score >= G:
            while p:
                score += (t+1)*100
                cnt += 1
                p -= 1
                if score >= G:
                    break
            ans = min(ans, cnt)
    else:
        ans = min(ans, cnt)
print(ans)

d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    P,C=list(map(int,input().split()))
    p.append(P)
    c.append(C)
ans=sum(p)
for i in range(2**d):
    z=i
    x=[]
    for j in range(d):
        x.append(z%2)
        z=z//2
    po=0
    m=0
    for j in range(d):
        if x[j]==1:
            po+=100*(j+1)*p[j]+c[j]
            m+=p[j]
    q=[[] for j in range(d)] #残りp、c
    s=0
    for j in range(d):
        if x[j]==0:
            q[s].append(100*(j+1))
            q[s].append(p[j])
            s+=1
    q=[q[j] for j in range(d) if q[j]!=[]]
    q=sorted(q,reverse=True)
    w=len(q)
    for j in range(w):
        q[j][1]-=1
    if po>=g:
        ans=min(ans,m)
    else:
        for j in range(w):
            if po+q[j][0]*q[j][1]>=g:
                m+=(g-po+q[j][0]-1)//q[j][0]
                ans=min(ans,m)
                break
            else:
                po+=q[j][0]*q[j][1]
                m+=q[j][1]
print(ans)


def ForBaseConvert(Roop,MaxD,Base):
    if all(type(TT) is int for TT in [Roop,MaxD,Base]):
        if Base>=2 and MaxD>=1:
            ConvertN = []
            while Roop>0:
                ConvertN.append(Roop%Base)
                Roop = Roop//Base

            BaseConv = [0]*(MaxD-len(ConvertN))+ConvertN[::-1]
            BaseSInd = [[] for TB in range(0,Base)]
            for TB in range(0,Base):
                BaseSInd[TB] = [SInd for SInd,SNum in enumerate(BaseConv) if SNum==TB]
            return BaseConv,BaseSInd
        else:
            return []
    else:
        return []

import math
D,G = (int(T) for T in input().split())
PCList = [[] for TD in range(0,D)]
MINSolve = 1000
for TD in range(0,D):
    PCList[TD] = [int(T) for T in input().split()]

for Roop in range(0,2**D):
    Failed = False
    BaseConv,BaseSInd = ForBaseConvert(Roop,D,2)
    Solve = 0
    Point = 0
    for TD in range(0,D):
        if BaseConv[TD]==1:
            Solve += PCList[TD][0]
            Point += (100*(TD+1)*PCList[TD][0])+PCList[TD][1]
    
    if len(BaseSInd[0])>0:
        Add = BaseSInd[0][-1]
        Ned = math.ceil(max(G-Point,0)/(100*(Add+1)))
        if Ned<=(PCList[Add][0]-1):
            Solve += Ned
            Point += 100*(Add+1)*Ned
     
    if Point>=G and Solve<MINSolve:
        MINSolve = Solve
print(MINSolve)

#!/usr/bin/env python3
import sys
from itertools import combinations_with_replacement,product
def input(): return sys.stdin.readline().rstrip()


def main():
    D,G=list(map(int, input().split()))
    problem=[]
    for i in range(1,D+1):
        p,c=list(map(int, input().split()))
        problem.append([i,p,c])
    ans=10000000
    for bit in list(product([0,1],repeat=D)):
        pnum=0
        nokori=G
        notcomp=[]
        for i in range(D):
            if bit[i]==1:
                pnum+=problem[i][1]
                nokori-=problem[i][2]+problem[i][1]*problem[i][0]*100
            else:
                notcomp.append(problem[i])
        while nokori>0 and notcomp:
            score,p,c=notcomp.pop()
            if score*(p-1)*100<=nokori:
                nokori-=score*(p-1)*100
                pnum+=p-1
            else:
                tmp=score*100
                pnum+=(nokori+tmp-1)//tmp
                nokori=0
        if nokori<=0:
            ans=min(ans,pnum)
    print(ans)
    


def __starting_point():
    main()


__starting_point()

D, G = list(map(int, input().split()))
p = [0] * D
c = [0] * D
for i in range(D):
    p[i], c[i] = list(map(int, input().split()))

ans = 1001
import math
for i in range(2**D):
    pp = 0
    t = 0
    b = format(i, "0" + str(D) + "b")
    #print(b)
    for j in range(D):
        pp += (100 * (j + 1) * p[j] + c[j]) * int(b[j])
        t += p[j] * int(b[j])
    if pp >= G:
        ans = min(ans, t)
        continue
    for k in range(D-1, -1, -1):
        if b[k] == "0":
            a = math.ceil((G - pp)//100/(k+1))
            if a < p[k]:
                t += a
                ans = min(ans, t)
                break
            else:
                t += p[k]-1
                pp += 100* (k + 1) *(p[k] - 1)

print(ans)


from itertools import accumulate
from itertools import product

D,G = list(map(int, input().split()))
points = []
for i,_ in enumerate(list(range(D)), 1):
    P,C = list(map(int, input().split()))
    point = list(accumulate([100*i] * P))
    point[-1] += C
    points.append(point)

# 中途半端に解く問題は1問だけ。解くなら高得点ほど良い。
ans = 1000
for completes in product(list(range(2)), repeat=D):
    solves = 0
    total = 0
    ex_points = []
    for comp, point in zip(completes, points):
        if comp:
            total += point[-1]
            solves += len(point)
        else:
            ex_points = point

    # 目標に届かない場合、高配点を追加で解く
    if total < G:
        for i,p in enumerate(ex_points,1):
            if total + p >= G:
                # 目標に届いた
                solves += i
                break
        else:
            # 目標に届かない
            continue
        
    ans = min(ans, solves)
                
print(ans)


# まだ解いてない配点を nokori として持つ
def dfs(i, sum, count, nokori):
    nonlocal ans
    if i == d:
        # G 点に満たなければ nokori のうち一番大きいものを解く
        if sum < g:
            use = max(nokori)
            # 解く問題が問題数を超えないように注意
            n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
            count += n
            sum += n * use * 100

        if sum >= g:
            ans = min(ans, count)
    else:
        # 総合スコア、解いた問題数、まだ解いてない問題を更新
        dfs(i + 1, sum, count, nokori)
        dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], nokori - {i + 1})


d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

dfs(0, 0, 0, set(range(1, d + 1)))
print(ans)

import itertools
from typing import List, Tuple


def main():
    d, g = list(map(int, input().split()))
    v = []
    for _ in range(d):
        p, c = list(map(int, input().split()))
        v.append((p, c))

    print((ag(v, g)))


def ag(v: List[Tuple[int, int]], g: int) -> int:
    # ex. [(3, 500), (5, 800)] -> [(1, 3, 500), (2, 5, 800)]
    v = [(i + 1, v[i][0], v[i][1]) for i in range(len(v))]

    result = 100 ** 10

    for j in range(len(v) + 1):
        for cb in itertools.combinations(v, j):
            sc = 0
            cnt = 0
            # calc bonus score
            for (i, p, c) in cb:
                sc += i * 100 * p + c
                cnt += p

            for idx in reversed(list(range(len(v)))):
                if sc >= g:
                    break
                if v[idx] in cb:
                    continue
                i, p, _ = v[idx]
                for _ in range(p - 1):
                    if sc >= g:
                        break
                    sc += i * 100
                    cnt += 1

            if sc >= g:
                result = min(result, cnt)
    return result


def __starting_point():
    main()

__starting_point()

# -*- coding: utf-8 -*-
# モジュールのインポート
import math


def get_input() -> tuple:
    """
    標準入力を取得する.

    Returns:\n
        tuple: 標準入力
    """
    D, G = list(map(int, input().split()))
    p, c = [], []
    for i in range(D):
        p_i, c_i = list(map(int, input().split()))
        p.append(p_i)
        c.append(c_i)

    return D, G, p, c


def main(D: int, G: int, p: list, c: list) -> None:
    """
    メイン処理.

    Args:\n
        D (int): 難易度の数(1 <= D <= 10)
        G (int): 目標スコア(100 <= G, 100の倍数)
        p (list): 問題数(1 <= p_i <= 100)
        c (list): コンプリートボーナス(100 <= c_i <= 10^6, 100の倍数)
    """
    # 求解処理
    ans = sum(p)
    for bit in range(2 << D):
        d = 0
        cnt = 0
        score = 0
        for i in range(D):
            if (bit >> i) & 1:
                cnt += p[i]
                score += 100 * (i + 1) * p[i] + c[i]
            else:
                d = i
        if score < G:
            cnt_d = min(math.ceil((G - score) / (100 * (d + 1))), p[d] - 1)
            cnt += cnt_d
            score += 100 * (d + 1) * cnt_d

        if score >= G:
            ans = min(ans, cnt)

    # 結果出力
    print(ans)


def __starting_point():
    # 標準入力を取得
    D, G, p, c = get_input()

    # メイン処理
    main(D, G, p, c)

__starting_point()

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = 100000000000000

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

d,g=[int(_) for _ in input().split()]
l=[0]+[list(map(int,input().split())) for _ in  range(d)]
def f(i,g):
	if i==0:return 10**9
	c=min(g//(100*i),l[i][0])
	s=100*i*c
	if c==l[i][0]:s+=l[i][1]
	if s<g:
		c+=f(i-1,g-s)
	return min(c,f(i-1,g))
print(f(d,g))

import copy

from typing import List, Tuple


def main():
    d, g = list(map(int, input().split()))
    v = []
    for _ in range(d):
        p, c = list(map(int, input().split()))
        v.append((p, c))

    print((ag(v, g)))


def ag(v: List[Tuple[int, int]], g: int) -> int:
    # ex. [(3, 500), (5, 800)] -> [(1, 3, 500), (2, 5, 800)]
    v = [(i, p, c) for i, (p, c) in enumerate(v, 1)]

    result = 100 ** 10
    for j in range(2 ** len(v)):
        cb = []
        for k in range(len(v)):
            if ((j >> k) & 1):
                cb.append(v[k])

        sc = 0
        cnt = 0
        # calc bonus score
        for (i, p, c) in cb:
            sc += i * 100 * p + c
            cnt += p

        for idx in reversed(list(range(len(v)))):
            if sc >= g:
                break
            if v[idx] in cb:
                continue
            i, p, _ = v[idx]
            for _ in range(p - 1):
                if sc >= g:
                    break
                sc += i * 100
                cnt += 1

        if sc >= g:
            result = min(result, cnt)
    return result


def __starting_point():
    main()

__starting_point()

n,k = map(int,input().split())
L = []
for i in range(n):
    a,b = map(int,input().split())
    L.append([(i+1)*100,a,b])
#print(L)
ans = 10**10
if k < L[-1][0]*L[-1][1]:
    if k%L[-1][0] != 0:
        ans = (k//L[-1][0]+1)
    else:
        ans = (k//L[-1][0])

for i in range(1<<n):
    li = []
    score,score_zan,cnt = 0,0,0
    for j in range(n):
        if i>>j&1:
            score +=(L[j][0]*L[j][1] + L[j][2])
            cnt +=L[j][1]
            score_zan = k-score
        else:
            li.append(L[j])
    if score > 0 and score_zan <= 0:
        ans = min(ans,cnt)
    li.sort(reverse = True)
    #print(score,li,cnt,score_zan)
    if li and score_zan > 0:
        if score_zan < li[0][0]*li[0][1]:
            ans = min(ans,cnt + score_zan//li[0][0])
print(ans)

d, g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

ans = float("inf")

for bit in range(1 << d):
    count = 0
    sum = 0
    nokori = set(range(1, d + 1))

    for i in range(d):
        if bit & (1 << i):
            sum += pc[i][0] * (i + 1) * 100 + pc[i][1]
            count += pc[i][0]
            nokori.discard(i + 1)

    # G 点に満たなければ nokori のうち一番大きいものを解く
    if sum < g:
        use = max(nokori)
        n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
        count += n
        sum += n * use * 100

    if sum >= g:
        ans = min(ans, count)

print(ans)

d, g = list(map(int, input().split()))
pc = [0] + [list(map(int, input().split())) for i in range(d)]
def dfs(d_, g_):
    if d_ == 0:
        return float("inf")
    cnt = min(g_ // (d_ * 100), pc[d_][0])
    cur = cnt * 100 * d_
    if cnt == pc[d_][0]:
        cur += pc[d_][1]
    if g_ > cur:
        cnt += dfs(d_ - 1, g_ - cur)
    return min(cnt, dfs(d_ - 1, g_))
print((dfs(d, g)))


D,G=list(map(int,input().split()))
p=list()
c=list()
for _ in range(D):
  P,C=list(map(int,input().split()))
  p.append(P)
  c.append(C)
ans=1<<29
for bit in range(1<<D):
  sum_=0
  num_=0
  for i in range(D):
    if bit&(1<<i):
      sum_+=c[i]+p[i]*100*(i+1)
      num_+=p[i]
  if sum_>=G:
    ans=min(ans,num_);
  else:
    for i in range(D-1,-1,-1):
      if bit&(1<<i):
        continue
      for j in range(p[i]):
        if sum_>=G:
          break
        sum_+=100*(i+1)
        num_+=1
    ans=min(ans,num_);
print(ans)