CodeEff/ECCO huggingface dataset:
# Original solution
d, g = [int(i) for i in input().split()]
p = [0] + [[int(i) for i in input().split()] for _ in range(d)]

def recursive(d, g):
    if d == 0:
        return 10 ** 9
    n = min(g // (100 * d), p[d][0])
    t = 100 * d * n
    # Full
    if n == p[d][0]:
        t += p[d][1]
    # Partial
    if t < g:
        n += recursive(d-1, g-t)
    return min(n, recursive(d-1, g))

def bit(d, g):
    ans = 10 ** 9
    for i in range(2 ** d):
        b = '-' + format(i, '0{}b'.format(d))
        last_zero_index = 0
        tmp_ans = 0
        total_score = 0
        for j in range(1, d+1):
            if b[j] == '1':
                total_score += p[j][0] * (100 * (j))
                total_score += p[j][1]
                tmp_ans += p[j][0]
            else:
                last_zero_index = j
        if total_score < g:
            diff = g - total_score
            q = diff // (100 * last_zero_index)
            r = diff % (100 * last_zero_index)
            if r != 0:
                q += 1
            if q > p[last_zero_index][0]:
                continue
            else:
                tmp_ans += q
        ans = min(ans, tmp_ans)
    return ans

#solve = recursive
solve = bit
print((solve(d, g)))


# Optimized solution
d, g = [int(i) for i in input().split()]
p = [0] + [[int(i) for i in input().split()] for _ in range(d)]

def recursive(d, g):
    if d == 0:
        return 10 ** 9
    n = min(g // (100 * d), p[d][0])
    t = 100 * d * n
    # Full
    if n == p[d][0]:
        t += p[d][1]
    # Partial
    if t < g:
        n += recursive(d-1, g-t)
    return min(n, recursive(d-1, g))

def bit(d, g):
    ans = 10 ** 9
    for i in range(2 ** d):
        b = '-' + format(i, '0{}b'.format(d))
        last_zero_index = 0
        tmp_ans = 0
        total_score = 0
        for j in range(1, d+1):
            if b[j] == '1':
                total_score += p[j][0] * (100 * (j))
                total_score += p[j][1]
                tmp_ans += p[j][0]
            else:
                last_zero_index = j
        if total_score < g:
            diff = g - total_score
            q = diff // (100 * last_zero_index)
            r = diff % (100 * last_zero_index)
            if r != 0:
                q += 1
            if q > p[last_zero_index][0]:
                continue
            else:
                tmp_ans += q
        ans = min(ans, tmp_ans)
    return ans

solve = recursive
#solve = bit
print((solve(d, g)))
# Original solution
def rec(i, g, count, rem):
    global ans
    if i == D:
        # 総得点がGを超えていなければ、remの中の最高配点の問題を解く
        if g < G:
            # 解く問題
            use = max(rem)
            c = min(pc[use-1][0], -(-(G-g) // (use*100)))
            count += c
            g += use*100 * c
            
        if g >= G:
            ans = min(ans, count)
    else:
        # 全部解かない
        rec(i+1, g, count, rem)
        # 全部解く
        rec(i+1, g+(i+1)*100*pc[i][0]+pc[i][1], count+pc[i][0], rem-{i+1})

# 入力
D, G = list(map(int, input().split()))
pc = [[int(i) for i in input().split()] for j in range(D)]
# 解いてない問題リスト
rem = set(range(1, D+1))
ans = float("inf")

rec(0, 0, 0, rem)

print(ans)

# Optimized solution
def rec(i, g, count, rem):
    global ans
    if i == 0:
        # 総得点がGを超えていなければ、remの中の最高配点の問題を解く
        if g < G:
            # 解く問題
            use = max(rem)
            c = min(pc[use-1][0], -(-(G-g) // (use*100)))
            count += c
            g += use*100 * c
            
            
        if g >= G:
            ans = min(ans, count)
            
    else:
        # 全部解かない
        rec(i-1, g, count, rem)
        # 全部解く
        rem[i] = 0
        rec(i-1, g+i*100*pc[i-1][0]+pc[i-1][1], count+pc[i-1][0], rem)
        rem[i] = i

# 入力
D, G = list(map(int, input().split()))
pc = [[int(i) for i in input().split()] for j in range(D)]
# 解いてない問題リスト
rem = [i for i in range(D+1)]
ans = float("inf")

rec(D, 0, 0, rem)

print(ans)
# Original solution
import math
from itertools import permutations
d,g = list(map(int,input().split()))
x = []
for i in range(d):
    x1,y1=[int(i) for i in input().split()]
    x.append([x1,y1])
zy = [i for i in range(1,d+1)]
zyu = list(permutations(zy, d))
ans2 = 100000000000000000000000
gou = g+0
for i in zyu:
  ans = 0
  g = gou +0
  while g > 0:
    for j in i:
      if g <= 0:
        break
      dai = x[-j][0]
      if g > (d-j+1)*100*dai:
        g-= ((d-j+1)*100*dai +x[-j][1])
        ans += dai
        continue
      else:
        ans += math.ceil(g/((d-j+1)*100))
        g = 0
      g -= x[-j][1]
  ans2 = min(ans,ans2)
print((int(ans2)))

# Optimized solution
import math
from itertools import combinations
d,g = list(map(int,input().split()))
x = []
for i in range(d):
    x1,y1=[int(i) for i in input().split()]
    x.append([x1,y1])
zy = [i for i in range(1,d+1)]
zyu = []
for i in range(d+1):
  zyu.extend(list(combinations(zy, i)))
ans2 = 100000000000000000000000
gou = g+0
for i in zyu:
  ans = 0
  g = gou +0
  for j in i:
    g -= (x[j-1][0] * j*100 + x[j-1][1])
    ans += x[j-1][0]
  if g >0:
    y = d+0
    while y in i:
      y -= 1
    a = x[y-1][0]
    if g > a*y*100:
      continue
    ans += math.ceil(g/(y*100))
  ans2 = min(ans,ans2)
print(ans2)
# Original solution
D, G = list(map(int,input().split()))
pc = [list(map(int,input().split())) for _ in range(D)]

ans = 1e9
for i in range(1 << D):
  cnt = 0
  point = 0
  for j in range(D):
    if(((i >> j) & 1) == 1):
      point += pc[j][0]*100*(j+1) + pc[j][1]
      cnt += pc[j][0]
    else:
      tmp = j
  if(point < G):
    x = G - point
    if((pc[tmp][0]-1)*(tmp+1)*100 < x):
      continue
    cnt += -(-x//(100*(tmp+1)))
  ans = min(ans, cnt)
print(ans)

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

ans = 1e9
for i in range(1 << D):
  point = 0
  cnt = 0
  for j in range(D):
    if(((i >> j) & 1) == 1):
      point += PC[j][0]*(j+1)*100 + PC[j][1]
      cnt += PC[j][0]
    else:
      tmp = j
  if(point < G):
    x = G - point
    if((PC[tmp][0]-1)*(tmp+1)*100 < x):
      continue
    cnt += -(-x//(100*(tmp+1)))
  ans = min(ans, cnt)
print(ans)
# Original solution
D, G = list(map(int,input().split()))
PC = [list(map(int,input().split())) for _ in range(D)]

ans = 1e9
for i in range(1 << D):
  point = 0
  cnt = 0
  for j in range(D):
    if(((i >> j) & 1) == 1):
      point += PC[j][0]*(j+1)*100 + PC[j][1]
      cnt += PC[j][0]
    else:
      tmp = j
  if(point < G):
    x = G - point
    if((PC[tmp][0]-1)*(tmp+1)*100 < x):
      continue
    cnt += -(-x//(100*(tmp+1)))
  ans = min(ans, cnt)
print(ans)

# Optimized solution
D, G = list(map(int,input().split()))
PC = [0]+[list(map(int,input().split())) for _ in range(D)]

def dfs(d, g):
  if(d == 0):
    return 1e9

  x = min(g//(100*d), PC[d][0])
  point = x*100*d

  if(x == PC[d][0]):
    point += PC[d][1]
  
  if(point < g):
    x += dfs(d-1, g-point)
  
  return min(x, dfs(d-1, g))
print((dfs(D, G)))
# Original solution
import itertools
import math

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

res = float('inf')
for indices in itertools.permutations(list(range(d))):
    count = 0
    s = 0
    for i in indices:
        p, c = ls[i]
        if s + 100 * (i + 1) * p >= g:
            count += math.ceil((g - s) / (100 * (i + 1)))
            break
        else:
            count += p
            if count >= res:
                break
            s += 100 * (i + 1) * p + c
            if s >= g:
                break
    res = min(res, count)
print(res)

# Optimized solution
import itertools
import math

d, g = list(map(int, input().split()))
ls = [[100 * (i + 1)] + list(map(int, input().split())) for i in range(d)]
s0 = [a * p for a, p, _ in ls]
s1 = [a * p + c for a, p, c in ls]

res = float('inf')
for indices in itertools.permutations(list(range(d))):
    count = 0
    s = 0
    for i in indices:
        if s + s0[i] >= g:
            count += math.ceil((g - s) / (100 * (i + 1)))
            break
        else:
            count += ls[i][1]
            if count >= res:
                break
            s += s1[i]
            if s >= g:
                break
    res = min(res, count)
print(res)
# Original solution
D, G = list(map(int, input().split(' ')))
p_list = list()
c_list = list()
for _ in range(D):
    p, c = list(map(int, input().split(' ')))
    p_list.append(p)
    c_list.append(c)
num_prob_list = [0] * D
min_prob_num_sum = sum(p_list)


def dfs(prob_index=-1, prob_num=0, current_prob_num_sum=0, current_score=0):
    """
    Returns whether score >= G with local minimum of problems.
    """
    global min_prob_num_sum
    if prob_index >= 0:
        current_prob_num_sum += prob_num
        if current_prob_num_sum >= min_prob_num_sum:
            return False
        num_prob_list[prob_index] = prob_num
        current_score += 100 * (prob_index + 1) * prob_num
        if prob_num == p_list[prob_index]:
            current_score += c_list[prob_index]
        if current_score >= G:
            min_prob_num_sum = current_prob_num_sum
            # print(num_prob_list[:(prob_index + 1)])
            # print(current_score)
            return True
    next_prob_index = prob_index + 1
    if next_prob_index > D - 1:
        return False
    for next_prob_num in range(p_list[next_prob_index] + 1):
        if dfs(next_prob_index, next_prob_num, current_prob_num_sum, current_score):
            break


dfs()
print(min_prob_num_sum)

# Optimized solution
import itertools
import math
D, G = list(map(int, input().split(' ')))
p_list = list()
c_list = list()
for _ in range(D):
    p, c = list(map(int, input().split(' ')))
    p_list.append(p)
    c_list.append(c)
ans = sum(p_list)
pattern_list = itertools.product([0, 1], repeat=D)
for pattern in pattern_list:
    score = 0
    prob_num = 0
    # Solve all problems with bit `1`
    score += sum([bit * (100 * (index + 1) * p_list[index] + c_list[index]) for index, bit in enumerate(pattern)])
    prob_num += sum([bit * p_list[index] for index, bit in enumerate(pattern)])
    # Solve problems partially with bit `0'
    if score < G:
        for index in range(D - 1, -1, -1):
            if pattern[index] == 1:
                # skip because these cases are already counted
                continue
            required_num = math.ceil((G - score) / (100 * (index + 1)))
            sol_num = min([p_list[index] - 1, required_num])
            score += 100 * (index + 1) * sol_num
            prob_num += sol_num
            if score >= G:
                break
    # update answer
    if score >= G:
        ans = min([ans, prob_num])
print(ans)
# Original solution
D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        # for i in additional_:
        #     if i[1] > 1:
        #         add_score = i
        #         break

        add_score = additional_[0]

        for k in range(add_score[1]-1):
            score += add_score[0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)

# Optimized solution
D, G = [int(n) for n in input().split()]

score_table = []
for i in range(1, D+1):
    p, c = [int(n) for n in input().split()]
    score_table.append([i*100, p, c])

min_count = sum([l[1] for l in score_table])
#print(min_count)

for bit in range(1<<D):
    score = 0
    count = 0

    for i in range(D):
        if bit & (1<<i):
            score += score_table[i][0] * score_table[i][1] + score_table[i][2]
            count += score_table[i][1]
    
    if score >= G:
        min_count = min(min_count, count)
    else:
        additional = []
        for j in range(D):
            if not bit & (1<<j):
                additional.append(score_table[j])
        
        additional_ = sorted(additional, key=lambda x:x[0], reverse=True)
        #print(additional_)
        
        # for i in additional_:
        #     if i[1] > 1:
        #         add_score = i
        #         break

        #add_score = additional_[0]

        for k in range(additional_[0][1]-1):
            score += additional_[0][0]
            count += 1
            if score >= G:
                min_count = min(min_count, count)

print(min_count)
# Original solution
d,g=list(map(int,input().split()))
data=[]
cp=[]
for  i in range(1,d+1):
    p,c=list(map(int,input().split()))
    data.append(p)
    cp.append(c)
a=99999999
for i in range(1024):
    ct=0
    ans=0
    tmp=data[:]
    for j in range(d):
        if i&(1<<j):
            ct+=100*(j+1)*data[j]+cp[j]
            ans+=data[j]
            tmp[j]=0
            
    p=len(tmp)-1
    while ct<g :
        if tmp[p]>1:
            ct+=100*(p+1)
            tmp[p]-=1
            ans+=1
        else:
            p-=1
        if p<0:
            ans=99999999
            break
    a=min(a,ans)
print(a)
    

# Optimized solution
d,g=list(map(int,input().split()))
data=[]
for i in range(d):
    p,c=list(map(int,input().split()))
    data.append((p,c))
n=0
mn=99999999
while n<2**d:
    point=0
    count=0
    for i in range(d):
        if n&(1<<i):
            point+=data[i][0]*100*(i+1)+data[i][1]
            count+=data[i][0]
    if point<g:
        for i in range(d):
            i=d-1-i
            if not n&(1<<i):
                for j in range(data[i][0]-1):
                    point+=(i+1)*100
                    count+=1
                    if point>=g:
                        mn=min(mn,count)
                        break
                else:
                    break
                break
    else:
        mn=min(mn,count)
    n+=1
print(mn)
# Original solution
D, G = [int(i) for i in input().split()]
pc = [list([int(x) for x in input().split()]) for i in range(D)]
pc.insert(0,[])
ans = float('inf')

def f(score, i, kaitousu):
	global ans
	if i <= D:
		for j in range(pc[i][0] + 1):
			if j == pc[i][0]:
				newScore = score + 100 * i * j + pc[i][1]
			else:
				newScore = score + 100 * i * j
			newKaitousu = kaitousu + j
			if newScore >= G:
				if newKaitousu < ans:
					ans = newKaitousu
				break
			else:
				f(newScore, i + 1, newKaitousu)

f(0, 1, 0)
print(ans)

# Optimized solution
D, G = list(map(int, input().split()))
P = [0]
C = [0]
ans = 0
for _ in range(D):
    p, c = list(map(int, input().split()))
    P.append(p)
    C.append(c)
    ans += p

for i in range(1<<D):
    point = 0
    count = 0
    for j in range(D, 0, -1):
        if i>>j-1&1:
            point += j * 100 * P[j] + C[j]
            count += P[j]
    for k in range(D, 0, -1):
        if not i>>k-1&1 and P[k] > 1:
            for _ in range(P[k]-1):
                if point < G:
                    point += k * 100
                    count += 1
                else:
                    break
            if point >= G:
                ans = min(ans, count)
            break
print(ans)
# Original solution
D,G=list(map(int,input().split()))
p=[0]*D
c=[0]*D
ans=1000000000
for i in range(D):
    p[i],c[i]=list(map(int,input().split()))
for i in range(1<<D):
    s=0
    cnt=0
    P=[0]*D
    for j in range(D):
        if ((i>>j)&1)==1:
            s+=c[j]+(j+1)*p[j]*100
            cnt+=p[j]
            P[j]=1
    while s<G:
        for k in range(D):
            if s>=G:
                break
            if P[D-k-1]==0:
                for l in range(p[D-k-1]-1):
                    if s>=G:
                        break
                    else:
                        s+=(D-k)*100
                        cnt+=1
    if cnt<ans:
        ans=cnt
print(ans)

# Optimized solution
D,G=list(map(int,input().split()))
p=[0]*D
c=[0]*D
ans=1000000000
for i in range(D):
    p[i],c[i]=list(map(int,input().split()))
for i in range(1<<D):
    s=0
    cnt=0
    P=[0]*D
    for j in range(D):
        if ((i>>j)&1)==1:
            s+=c[j]+(j+1)*p[j]*100
            cnt+=p[j]
            P[j]=1
    m=-1
    for k in range(D):
        if m<0:
            if P[D-k-1]==0:
                m=D-k
        else:
            break
    if m>=0:
        for l in range(p[m-1]-1):
            if s<G:
                s+=m*100
                cnt+=1
    if s>=G and cnt<ans:
        ans=cnt
print(ans)
# Original solution
import math

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

digit = "0"+str(D)+"b"
ans = float('INF')
for i in range(2**D):
  pattern = list(str(format(i,digit)))
  point = 0
  count = 0
  last0 = -1
  for j in range(D):
    if pattern[j] =="1":
      point += pc[j][1]+pc[j][0]*100*(j+1)
      count += pc[j][0]
    else:
      last0 = j
  r = G - point
  if r > 0 and last0 > -1:
    tmp = math.ceil(r/(100*(last0+1)))
    if tmp < pc[last0][0]:
      count += tmp
      ans = min(ans,count)
  elif r <= 0:
    ans = min(ans,count)
  
print(ans)

# Optimized solution
import math

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

minimam=float('INF')

digit = "0"+str(D)+"b"

for i in range(2**D):
  pattern = str(format(i,digit))
  #この完答パターンのときの完答に伴う問題数と得点を算出する
  point = 0
  count = 0
  for j in range(D):
    if pattern[j]=="1":
      count += pc[j][0]
      point += pc[j][0]*100*(j+1)+pc[j][1]
  #ポイントがGに未達の場合、残りの問題を解いてみて、Gに到達するか検証。
  #到達する場合でなおかつ問題数が最小であれば記録する。
  last0 = pattern.rfind("0")
  r = G -point
  if r > 0:
    if last0==-1:
      continue
    tmp = math.ceil(r/(100*(last0+1)))
    if tmp < pc[last0][0]:
      minimam = min(minimam,tmp+count)
  else:
    minimam = min(minimam,count)

print(minimam)
# Original solution
import math

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

digit = "0"+str(D)+"b"
ans = float("INF")
for i in range(2**D):
  flags = list(str(format(i,digit)))
  points = 0
  problems = 0
  last0 = -1
  #まずは完答組での点数を算出
  for j in range(D):
    if int(flags[j]):
      points += pc[j][0]*100*(j+1)+pc[j][1]
      problems += pc[j][0]
    else:
      last0 = j
  if points >= G:
    ans = min(ans,problems)
    continue
  elif last0 == -1:
    continue
  else:
    r = G-points
    need = math.ceil(r/(100*(last0+1)))
    if need > pc[last0][0]-1:
      continue
    else:
      ans = min(ans,problems+need)
      
print(ans)

# Optimized solution
import math

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

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

digit = "0"+str(D)+"b"
ans = float("INF")
for i in range(2**D):
    flags = list(str(format(i,digit)))
    points = 0
    count = 0
    last0 = -1
    for j in range(D):
        if flags[j]=="1":
            points += pc[j][0]*100*(j+1) + pc[j][1]
            count += pc[j][0]
        else:
            last0 = j
    r = G - points
    if r<=0:
        ans = min(ans,count)
    else:
        if last0 == -1:
            continue
        need = math.ceil(r/(100*(last0+1)))
        if need >= pc[last0][0]:
            continue
        else:
            count += need
            ans = min(ans,count)

print(ans)
# Original solution
import sys
sys.setrecursionlimit(10000)
D, G = list(map(int, input().split(' ')))
left = {}
bonus = {}
for i in range(1, D+1):
    left[i], bonus[i] = list(map(int, input().split(' ')))
 
big = 9999999
 
probably_ans = big
def hogehoge(depth, index, pt, left, bonus, probably_ans):
    if pt >= G:
        return depth
    if depth >= probably_ans or index > D:  # 遅いかも
        return big
    
    # 一つも引かない
    probably_ans = min(probably_ans, hogehoge(depth, index + 1, pt, left, bonus, probably_ans))
    
    # 全部引いて index reset
    for k in range(0, D - index + 1):
        if left[index + k]:
            temp = left[index + k]
            left[index + k] = 0
            probably_ans = min(probably_ans, hogehoge(depth+temp, 1, pt + (index + k) * 100 * temp + bonus[index + k], left, bonus, probably_ans))
            left[index + k] = temp

    # 歯抜け状態から行けそうならクリア
    if left[index]:
        if pt + index * 100 * left[index] + bonus[index] >= G:
            for i in range(1, left[index] + 1):
                left[index] = left[index] - i
                new_pt = pt + index * 100 * i + bonus[index] * (left[index] == 0)
                if (new_pt >= G):
                    probably_ans = min(probably_ans, hogehoge(depth+i, index+1, new_pt, left, bonus, probably_ans))
                left[index] = left[index] + i
    return probably_ans
    
print((hogehoge(0, 1, 0, left, bonus, probably_ans)))

# Optimized solution
import sys
sys.setrecursionlimit(10000)
D, G = list(map(int, input().split(' ')))
left = {}
bonus = {}
for i in range(1, D+1):
    left[i], bonus[i] = list(map(int, input().split(' ')))
 
big = 9999999
 
probably_ans = big
memo = {}
def hogehoge(depth, index, pt, left, bonus, probably_ans):
    key = (depth, index, pt, str(left))
    if key in memo:
        return memo[key]
    if pt >= G:
        return depth
    if depth >= probably_ans or index > D:  # 遅いかも
        return big
    
    # 一つも引かない
    probably_ans = min(probably_ans, hogehoge(depth, index + 1, pt, left, bonus, probably_ans))
    
    # 全部引いて index reset
    for k in range(0, D - index + 1):
        if left[index + k]:
            temp = left[index + k]
            left[index + k] = 0
            probably_ans = min(probably_ans, hogehoge(depth+temp, 1, pt + (index + k) * 100 * temp + bonus[index + k], left, bonus, probably_ans))
            left[index + k] = temp

    # 歯抜け状態から行けそうならクリア
    if left[index]:
        if pt + index * 100 * left[index] + bonus[index] >= G:
            for i in range(1, left[index] + 1):
                left[index] = left[index] - i
                new_pt = pt + index * 100 * i + bonus[index] * (left[index] == 0)
                if (new_pt >= G):
                    probably_ans = min(probably_ans, hogehoge(depth+i, index+1, new_pt, left, bonus, probably_ans))
                left[index] = left[index] + i
    memo[key] = probably_ans
    return probably_ans
    
print((hogehoge(0, 1, 0, left, bonus, probably_ans)))
# Original solution
import itertools
D, G = list(map(int, input().split()))
score_list = []
for i in range(D):
    p, c = list(map(int, input().split()))
    score_list.append([(i + 1) * 100] * (p - 1) + [c + (i + 1) * 100])
full_score = [sum(i) for i in score_list]
per = list(itertools.permutations(list(range(D))))
ans = 10000

for k in per:
    pro = 0
    sco = 0
    for i in k:
        if G >= sco + full_score[i]:
            sco += full_score[i]
            pro += len(score_list[i])
        else:
            for j in score_list[i]:
                sco += j
                pro += 1
                if sco >= G:
                    break
                else:
                    continue
        if sco >= G:
            break
        else:
            continue
    if ans > pro:
        ans = pro
    else:
        continue
print(ans)

# Optimized solution
D, G = list(map(int, input().split()))
score_list = []
for i in range(D):
    p, c = list(map(int, input().split()))
    score_list.append([(i + 1) * 100] * (p - 1) + [c + (i + 1) * 100])
full_score = [sum(i) for i in score_list]
sol = [format(i, 'b').zfill(D) for i in range(2 ** D)]
ans = []

for i in sol:
    problem = 0
    score = 0
    for j in range(D):
        if i[j] == '1':
            score += full_score[j]
            problem += len(score_list[j])
        else:
            continue
    if score >= G:
        ans.append(problem)
    else:
        if score + full_score[i.rfind('0')] < G:
            continue
        else:
            while score < G:
                score += score_list[i.rfind('0')][0]
                problem += 1
            ans.append(problem)

print((min(ans)))