CodeEff/ECCO huggingface dataset:
# Original solution
from collections import deque
D,G = [int(i) for i in input().split()]
P = [0]*D
n = 0
for i in range(D):
    p,c = [int(j) for j in input().split()]
    P[i] = [int(k) * 100 * (i+1) for k in range(p+1)]
    P[i][-1] += c
    n += p
deq = deque()
ans = n
deq.append((0,0,0))
while(len(deq)>0):
    tmp = deq.pop()
    if tmp[0]+1 > len(P):
        break
    for i,j in enumerate(P[tmp[0]]):
        cand = (tmp[0]+1, tmp[1]+i, tmp[2]+j)
        if cand[2] < G:
            if cand[1] < ans:
                deq.appendleft(cand)
        else:
            if cand[1] < ans:
                ans = cand[1]      
print(ans)

# Optimized solution
from collections import deque
D,G = [int(i) for i in input().split()]
P = [0]*D
n = 0
for i in range(D):
    p,c = [int(j) for j in input().split()]
    P[i] = [int(k) * 100 * (i+1) for k in range(p+1)]
    P[i][-1] += c
    n += p
deq = deque()
ans = n
deq.append((0,0,0))
dic = {}

while(len(deq)>0):
    tmp = deq.pop()
    if tmp[0]+1 > len(P):
        break
    for i,j in enumerate(P[tmp[0]]):
        cand = (tmp[0]+1, tmp[1]+i, tmp[2]+j)
        if cand[1] < ans:
            if cand[2] < G:
                if cand[1] not in dic:
                    dic[cand[1]] = cand[2]
                    deq.appendleft(cand)
                elif dic[cand[1]] <= cand[2]:
                    dic[cand[1]] = cand[2]
                    deq.appendleft(cand)
            else:
                ans = cand[1]
print(ans)
# Original solution
import itertools


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

P     = [None] * D
C     = [None] * D
count = [None] * D
score = [None] * D

for i in range(D):
    p, c          = list(map(int, input().split()))
    P[i]          = p
    C[i]          = c
    count[i]      = list(range(p+1))
    score[i]      = [100 * (i+1) * j for j in range(p+1)]
    score[i][-1] += c

count = [sum(c) for c in list(itertools.product(*count))]
score = [sum(s) for s in list(itertools.product(*score))]

answer = [count[i] for i in range(len(count)) if score[i] >= G]

print((min(answer)))


# Optimized solution
import itertools


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

P     = [None] * D
C     = [None] * D
count = [None] * D
score = [None] * D

for i in range(D):
    p, c          = list(map(int, input().split()))
    P[i]          = p
    C[i]          = c
    count[i]      = list(range(p+1))
    score[i]      = [100 * (i+1) * j for j in range(p+1)]
    score[i][-1] += c

answer = sum(P)

for is_complete in itertools.product([True, False], repeat=D):
    score_tmp  = 0
    count_tmp  = 0
    score_tmp += sum([score[i][-1] for i in range(D) if is_complete[i]])
    count_tmp += sum([count[i][-1] for i in range(D) if is_complete[i]])
    while score_tmp < G:
        for i in list(range(D))[::-1]:
            if is_complete[i] == False:
                if (G - score_tmp) % (100 * (i+1)) == 0:
                    count_add  = min((G - score_tmp) // (100 * (i+1)),     P[i] - 1)
                else:
                    count_add  = min((G - score_tmp) // (100 * (i+1)) + 1, P[i] - 1)
                score_add      = 100 * (i+1) * count_add
                count_tmp     += count_add
                score_tmp     += score_add
            if score_tmp >= G:
                break
    if score_tmp >= G:
        answer = min(answer, count_tmp)

print(answer)
# Original solution
from collections import deque

def solve(d, g, pcs):
    queue = deque()
    queue.append((0, d, g, pcs, 0))
    while True:
        count, d, g, pcs, n = queue.popleft()
        #print(count, d, g, pcs)
        if g <= 0:
            return count
        if n > 0:
            p, c = pcs[n - 1]
            l = pcs.copy()
            if p == 1:
                l = pcs.copy()
                l[n - 1] = (0, 0)
                queue.append((count + 1, d, g - c - 100 * n, l, 0))
            elif p > 1:
                l = pcs.copy()
                l[n - 1] = (p - 1, c)
                queue.append((count + 1, d, g - 100 * n, l, n))
        else:
            for i in range(1, d + 1):
                p, c = pcs[i - 1]
                if p == 1:
                    l = pcs.copy()
                    l[i - 1] = (0, 0)
                    queue.append((count + 1, d, g - c - 100 * i, l, 0))
                elif p > 1:
                    l = pcs.copy()
                    l[i - 1] = (p - 1, c)
                    queue.append((count + 1, d, g - 100 * i, l, i))


if __name__ == "__main__":
    d, g = list(map(int, input().split()))
    pcs = [tuple(int(s) for s in input().split()) for _ in range(d)]
    print((solve(d, g, pcs)))


# Optimized solution
from collections import deque

def solve(count, i, g, pcs, rem):
    if g <= 0:
        return count
    if pcs == []:
        index, p = rem
        if index == 0:
            return count
        plus = g // (100 * index) + (1 if g % (100 * index) != 0 else 0)
        return count + plus if plus < p else float("Inf")
    p, c = pcs[0]
    l = pcs[1:]
    a = solve(count, i + 1, g, l, (i, p))
    b = solve(count + p, i + 1, g - c - 100 * i * p, l, rem)
    return a if a < b else b



if __name__ == "__main__":
    d, g = list(map(int, input().split()))
    pcs = [tuple(int(s) for s in input().split()) for _ in range(d)]
    print((solve(0, 1, g, pcs, (0, 0))))
# Original solution
D, G = list(map(int, input().split()))

G /= 100
l = [[0]*3 for i in range(D)]

for i in range(D):
    p, c = list(map(int, input().split()))
    l[i][0] = i+1
    l[i][1] = p
    l[i][2] = c/100

l = sorted(l, key=lambda x: x[0], reverse=True)


def dfs(i, scores):
    if scores <= 0:
        return 0

    if i == D:
        return 1e9

    a, p, b = l[i]

    counts = [1e9]*(p+1)
    for j in range(p+1):
        if j == p:
            counts[j] = dfs(i+1, scores-a*p-b) + p
        elif scores-a*j >= 0:
            counts[j] = dfs(i+1, scores-a*j) + j

    ans = min(counts)
    return ans


ans = dfs(0, G)

print(ans)


# Optimized solution
from math import ceil

D, G = [int(t) for t in input().split()]
p = []
c = []
for i in range(D):
    p_, c_ = [int(t) for t in input().split()]
    p.append(p_)
    c.append(c_)


def minsolve(G, i):
    """100i点以下の問題だけでGを達成する最小問題数"""
    if i <= 0:
        return float('inf')
    n = min(ceil(G / (100 * i)), p[i-1])
    s = 100 * i * n
    if n == p[i-1]:
        s += c[i-1]
    m = n if s >= G else n + minsolve(G - s, i-1)
    return min(m, minsolve(G, i-1))


print((minsolve(G, D)))
# Original solution
INF = float('inf')

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

sumP = sum([p for p, c in pcs])

def max2(a, b):
    return a if a >= b else b


# 【配るDP】
# dp[i+1][j]: pcs[i]まで考慮したとき、j問で達成できるスコアの最大値
dp = [[-INF] * (sumP + 1) for i in range(D + 1)]
dp[0][0] = 0
for i, (p, c) in enumerate(pcs):
    for j in range(sumP + 1):
        if dp[i][j] != -INF:
            for k in range(p):
                dp[i + 1][j + k] = max2(dp[i + 1][j + k], dp[i][j] + 100 * (i + 1) * k)
            dp[i + 1][j + p] = max2(dp[i + 1][j + p], dp[i][j] + 100 * (i + 1) * p + c)

for j in range(sumP + 1):
    if dp[D][j] >= G:
        print(j)
        break


# Optimized solution
from math import ceil

D, G = list(map(int, input().split()))
ps, cs = [], []
for _ in range(D):
    p, c = list(map(int, input().split()))
    ps.append(p)
    cs.append(c)

ans = 1000
for pat in range(2 ** D):
    score = 0
    num = 0
    for i in range(D):
        if pat & (1 << i):
            score += 100 * (i + 1) * ps[i] + cs[i]
            num += ps[i]
        else:
            iRest = i

    if score < G:
        n = ceil((G - score) / (100 * (iRest + 1)))
        if n >= ps[iRest]: continue
        num += n

    ans = min(ans, num)

print(ans)
# Original solution

def count(P, idx, score, G, mn, cnt):
    # print(idx, score, mn, cnt)
    if score >= G and mn > cnt:
        return cnt
    if idx == 0:
        return mn
    for i in range(P[idx][0]+1):
        tmp = P[idx][1] if i == P[idx][0] else 0
        # print(idx, i)
        mn = count(P, idx-1, score+idx*100*i+tmp, G, mn, cnt+i)
    return mn

D,G = list(map(int, input().split()))
P = [0]
for i in range(D):
    p,c = list(map(int, input().split()))
    P.append([p,c])
print((count(P, D, 0, G, 10**9, 0)))


# Optimized solution
from math import ceil
d,g = list(map(int, input().split()))
pc = [list(map(int, input().split())) for i in range(d)]

ans = float('INF')
inf = float('INF')
for i in range(2**d):
    tmp = 0
    cnt = 0
    for j in range(d):
        p,c = pc[j]
        if i & (1 << j):
            tmp += p * (j+1) * 100 + c
            cnt += p
    if g <= tmp and cnt < ans:
        ans = cnt
    if g > tmp:
        tmp_cnt = inf 
        tmp_ = 0
        gg = (g - tmp) / 100
        for j in range(d):
            p,c = pc[j]
            if i & (1 << j):
                continue
            if ceil(gg / (j+1)) < min(p,tmp_cnt):
                cc = ceil(gg / (j+1))
                tmp_ = cc * (j+1) * 100
                tmp_cnt = cc
            elif gg - c / 100 <= p * (j+1) and p < tmp_cnt:
                tmp_ = p * (j+1) * 100 + c
                tmp_cnt = p
        if g <= tmp + tmp_ and cnt + tmp_cnt < ans:
            ans = cnt + tmp_cnt

print(ans)
# Original solution
"""解説から写経
D種類の配点の問題があり、それらを最低何問解けばG点以上取ることができるかを求める。
続くD行の入力から、配点iの問題数p[i]と追加点c[i]が与えられ、配点は100*(i+1)点となる。
追加点は配点i問題を全て解いたときに得られる追加点。

条件が成立する最小の問題数をansとし、とても大きな値で初期化しておく。
各配点の問題を全て解くか、解かないかを最初に決め、G点以上取れるかどうか、また、その時の解答数を確認していく。(bit全探索)
現在の点数、解答数、解かなかった問題の中で最も配点の高かったものをそれぞれ、s, num, rest_maxとする。
完全に解く問題を解き終えて、G点に満たなかった場合、配点[rest_max]をいくつか解くことでG点が取れるか確認していき、必要な解答数をneedとする。
この時、p[rest_max]-1より多く問題を解く必要があるなら、解答する問題の選択を間違えていると言えるので無視する。
num+needがansよりも少ない場合、ansの値を更新する。
"""
d, g = list(map(int, input().split()))
pc = []
for _ in range(d):
    pc.append(tuple(map(int, input().split())))
ans = float('inf')
for bits in range(1 << d):
    s = 0
    num = 0
    rest_max = -1
    for i in range(d):
        p, c = pc[i]
        if bits >> i & 1:
            s += 100 * (i + 1) * p + c
            num += p
        else:
            rest_max = i
    if s < g:
        s1 = 100 * (rest_max + 1)
        need = (g - s + s1 - 1) // s1  # s1-1を足すのは切り上げ？
        if need >= pc[rest_max][0]:
            continue
        num += need
    ans = min(ans, num)
print(ans)


# Optimized solution
D, G = list(map(int, input().split()))
P = [tuple(map(int, input().split())) for _ in range(D)]
ans = float('inf')
for bit in range(1 << D):
    score = 0
    count = 0
    rest = -1
    for i, pc in enumerate(P):
        p, c = pc
        if bit >> i & 1:
            score += 100 * (i + 1) * p + c
            count += p
        else:
            rest = i
    if score < G:
        s1 = 100 * (rest + 1)
        need = (G - score + s1 - 1) // s1
        if need >= P[rest][0]:
            continue
        count += need
    ans = min(ans, count)
print(ans)
# Original solution
D, G = list(map(int, input().split()))
p = [list(map(int, input().split())) for _ in range(D)]
plst = [0] * D
ans = 0
for i in range(D):
    ans += p[i][0]

def dfs(n):
    global ans
    if n == D:
        cnt = 0
        total = 0
        for i in range(D):
            if plst[i] == 0:
                continue
            elif plst[i] == 1:
                cnt += p[i][0]
                total += (100 * (i + 1) * p[i][0]) + p[i][1]
        for j in range(D):
            if plst[j] == 2:
                for k in range(p[j][0] - 1):
                    total += (100 * (j + 1))
                    cnt += 1
                    if total >= G:
                        ans = min(ans, cnt)
        if total >= G:
            ans = min(ans, cnt)
        return

    for i in range(3):
        plst[n] = i
        dfs(n + 1)
    return

dfs(0)
print(ans)

# Optimized solution
D, G = list(map(int, input().split()))
p = [list(map(int, input().split())) for _ in range(D)]
plst = [0] * D
ans = 0
for i in range(D):
    ans += p[i][0]

def dfs(n):
    global ans
    if n == D:
        cnt = 0
        total = 0
        for i in range(D):
            if plst[i] == 0:
                continue
            elif plst[i] == 1:
                cnt += p[i][0]
                total += (100 * (i + 1) * p[i][0]) + p[i][1]
        for j in range(D):
            if plst[j] == 2:
                for k in range(p[j][0] - 1):
                    total += (100 * (j + 1))
                    cnt += 1
                    if total >= G:
                        break
        if total >= G:
            ans = min(ans, cnt)
        return

    for i in range(3):
        plst[n] = i
        dfs(n + 1)
    return

dfs(0)
print(ans)
# Original solution
import math

d, g = list(map(int, input().split()))
l = [list(map(int, input().split())) for _ in range(d)]
ans = float('inf')

for i in range(2 ** d):
    sum = 0
    count = 0
    s = set(_ for _ in range(1, d + 1))
    for j in range(d):
        if (i >> j) & 1 == 1:
            sum += l[j][0] * (j + 1) * 100 + l[j][1]
            count += l[j][0]
            s.discard(j + 1)
    if sum < g:
        t = max(s)
        n = min(l[t - 1][0], math.ceil((g - sum) / (t * 100)))
        count += n
        sum += n * t * 100
    if sum >= g:
        ans = min(ans, count)
print(ans)


# Optimized solution
import math

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

ans = float('inf')
for i in range(2 ** d):
    sum = 0
    count = 0
    s = set(k for k in range(1, d + 1))
    for j in range(d):
        if (i >> j) & 1 == 1:
            sum += l[j][0] * (j + 1) * 100 + l[j][1]
            count += l[j][0]
            s.discard(j + 1)
    if sum < g:
        t = max(s)
        n = min(l[t - 1][0] - 1, math.ceil((g - sum) / (t * 100)))
        count += n
        sum += n * t * 100
    if sum >= g:
        ans = min(ans, count)
print(ans)
# Original solution
D, G = list(map(int, input().split()))

def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = str(X_dumy%n)+out
        X_dumy = int(X_dumy/n)
    return out

p = []
c = []
for _ in range(D):
	p_tmp, c_tmp = list(map(int,input().split()))
	p.append(p_tmp)
	c.append(c_tmp)
t = [(i+1)*100*p[i] + c[i] for i in range(D)]

ans = float("inf")

for i in range(2**D):
	flg = list(map(int, Base_10_to_n(i,2).rjust(D,"0")))
	tmp_score = sum([t[j] for j in range(D) if flg[j] == 1])
	cnt = sum([p[j] for j in range(D) if flg[j] == 1])

	if tmp_score < G:

		rst_max_q = max([j for j in range(D) if flg[j] == 0])

		rst_q_num = 0
		while rst_q_num < p[rst_max_q]:
			tmp_score += 100*(rst_max_q+1)
			rst_q_num += 1
			cnt += 1
			if tmp_score >= G:
				break

		if tmp_score < G:
			continue

	ans = min(ans, cnt)


print(ans)

# Optimized solution
import itertools

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

P_list = list(range(D))
cnt = float('inf')

for i in range(D):
	for bonus in itertools.combinations(P_list, i):

		tmp_cnt = 0
		score = 0

		for j in bonus:
			score += PC[j][0] * 100 * (j+1) + PC[j][1]
			tmp_cnt += PC[j][0]

		res_max_p = max([k for k in range(D) if k not in bonus])
		res_score = G - score
		if res_score > 0:
			t = (-res_score//((res_max_p+1)*100)) * (-1) 
			if t < PC[res_max_p][0]:
				tmp_cnt += t
			else:
				continue

		cnt = min(cnt, tmp_cnt)

if cnt == float('inf'):
	cnt = sum([PC[j][0] for j in range(D)])

print(cnt)
# Original solution
INF = float('inf')
d, g = list(map(int, input().split()))
data = []
for i in range(d):
  p, c = list(map(int, input().split()))
  data.append([p, c, (i + 1) * 100, (i + 1) * 100 * p + c])
def f(data, total, targets):
  if total <= 0:
    return 0
  result = INF
  for i in range(len(targets)):
    p, c, score, subtotal = data[targets[i]]
    t = (total + score - 1) // score
    if t < p and t < result:
      result = t
    t = p + f(data, total - subtotal, targets[0:i] + targets[i + 1:])
    if t < result:
      result = t
  return result
print((f(data, g, list(range(len(data))))))


# Optimized solution
INF = float('inf')
d, g = list(map(int, input().split()))
data = []
calced = set()
for i in range(d):
  p, c = list(map(int, input().split()))
  data.append([p, c, (i + 1) * 100, (i + 1) * 100 * p + c])
def f(data, total, targets):
  if total <= 0:
    return 0
  result = INF
  for i in range(len(targets)):
    p, c, score, subtotal = data[targets[i]]
    t = (total + score - 1) // score
    if t < p and t < result:
      result = t
    nt = tuple(targets[0:i] + targets[i + 1:])
    if nt not in calced:
      calced.add(nt)
      t = p + f(data, total - subtotal, nt)
      if t < result:
        result = t
  calced.add(targets)
  return result
print((f(data, g, tuple(range(len(data))))))
# Original solution
import itertools
d,g=list(map(int,input().split()))
pc=[list(map(int,input().split())) for _ in range(d)]
num=list(itertools.permutations(list(range(1,d+1))))
ans=100000
for i in range(d):
    pc[i][1]=pc[i][1]//100
g//=100
for i in range(len(num)):
    cnt=g
    cnt2=0
    for j in range(d):
        num3=num[i][j]
        num5=pc[num3-1][0]
        num4=num3*num5
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+pc[num3-1][1]>=cnt:
            cnt2+=num5
            break
        else:
            cnt-=num4+pc[num3-1][1]
            cnt2+=num5
    ans=min(ans,cnt2)
print(ans)


# Optimized solution
import itertools
d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    p1,c1=list(map(int,input().split()))
    p.append(p1)
    c.append(c1//100)
n=list(itertools.permutations(list(range(1,d+1))))
ans=3000
g//=100
for i in range(len(n)):
    cnt=g
    cnt2=0
    for j in range(d):
        num3=n[i][j]
        num5=p[num3-1]
        num4=num3*num5
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+c[num3-1]>=cnt:
            cnt2+=num5
            break
        else:
            cnt-=num4+c[num3-1]
            cnt2+=num5
    ans=min(ans,cnt2)
print(ans)
# Original solution
import itertools
d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    p1,c1=list(map(int,input().split()))
    p.append(p1)
    c.append(c1//100)
n=list(itertools.permutations(list(range(1,d+1))))
ans=3000
g//=100
for i in range(len(n)):
    cnt=g
    cnt2=0
    for j in range(d):
        num3=n[i][j]
        num5=p[num3-1]
        num4=num3*num5
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+c[num3-1]>=cnt:
            cnt2+=num5
            break
        else:
            cnt-=num4+c[num3-1]
            cnt2+=num5
    ans=min(ans,cnt2)
print(ans)


# Optimized solution
import itertools
d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    p1,c1=list(map(int,input().split()))
    p.append(p1)
    c.append(c1//100)
n=list(itertools.permutations(list(range(1,d+1))))
ans=2000
g//=100
for i in range(len(n)):
    cnt=g
    cnt2=0
    for j in range(d):
        num3=n[i][j]
        num4=num3*p[num3-1]
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+c[num3-1]>=cnt:
            cnt2+=p[num3-1]
            break
        else:
            cnt-=num4+c[num3-1]
            cnt2+=p[num3-1]
    ans=min(ans,cnt2)
print(ans)
# Original solution
d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    p1,c1=list(map(int,input().split()))
    p.append(p1)
    c.append(c1//100)
ans=1100
g//=100
import itertools
n=list(itertools.permutations(list(range(1,d+1))))
for i in range(len(n)):
    cnt=g
    cnt2=0
    for j in range(d):
        if cnt2>=ans:
            break
        num3=n[i][j]
        num4=num3*p[num3-1]
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+c[num3-1]>=cnt:
            cnt2+=p[num3-1]
            break
        cnt-=num4+c[num3-1]
        cnt2+=p[num3-1]
    ans=min(ans,cnt2)
print(ans)


# Optimized solution
import itertools
d,g=list(map(int,input().split()))
p=[]
c=[]
for i in range(d):
    p1,c1=list(map(int,input().split()))
    p.append(p1)
    c.append(c1//100)
n=list(itertools.permutations(list(range(1,d+1))))
ans=1100
g//=100
for i in range(len(n)):
    cnt=g
    cnt2=0
    for j in range(d):
        num3=n[i][j]
        num4=num3*p[num3-1]
        if num4>=cnt:
            cnt2+=((cnt-1)//num3)+1
            break
        elif num4+c[num3-1]>=cnt:
            cnt2+=p[num3-1]
            break
        else:
            cnt-=num4+c[num3-1]
            cnt2+=p[num3-1]
    ans=min(ans,cnt2)
print(ans)
# Original solution
from itertools import*
from math import*
d,g=list(map(int,input().split()))
g//=100
xxx=[tuple([i])+tuple(map(int,input().split()))for i in range(1,d+1)]   #問題数 ボーナス
#print(xxx)
yyy=[(score,score*num+bonus//100,num)for score,num,bonus in xxx]
ans=[]
l=[]
for i in range(d+1):
    for j in combinations(yyy,i):
        tmp1=0
        tmp2=0
        tmpl=set()
        for x,y,z in j:
            tmp1+=y
            tmp2+=z
            tmpl.add(x)
        if tmp1>=g:
            ans.append(tmp2)
        else:
            l.append((tmpl,g-tmp1,tmp2))  
#print(ans)
#print(l)
for s,t,r in l:  #使ったもの 必要なスコア そこまでの枚数
    for x,y,_ in xxx[::-1]:  #スコア 枚数
        if x not in s:
            if x*y<=t:
                break
            else:
#                print(r,t,x)
                ans.append(r+ceil(t/x))

print((min(ans)))

# Optimized solution
(d,g),*l=[list(map(int,i.split()))for i in open(0)]
def f(i,g):
	if i==0:return 1e9
	n,m=l[i-1];c=min(g//(100*i),n);s=100*i*c+m*(c==n);c+=f(i-1,g-s)*(s<g);return min(c,f(i-1,g))
print((int(f(d,g))))
# Original solution
import itertools
from collections import Counter
D, G = list(map(int, input().split()))
P = [list(map(int, input().split())) for i in range(D)]
min_num = 10**8

judge_list = list(itertools.product([0, 1, 2], repeat=D)) #0:中途半端に解く 1:一問も解かない 2: 全部解く


for judge in judge_list:
    score = 0
    num = 0
    d = Counter() #インスタンスを生成
    d.update(judge)
    if (d[0] <= 1):
        for i in range(1, len(judge) + 1):
            if score >= G:
                break

            if judge[-i] == 1:
                pass

            if judge[-i] == 2:
                score += P[-i][0] * (D - i + 1) * 100 + P[-i][1]
                num += P[-i][0]

            if (judge[-i] == 0):
                for j in range(P[-i][0]):
                    if score >= G:
                        break
                    score += 100 * (D - i + 1)
                    num += 1

        if score >= G:
            min_num = min(num, min_num)

print(min_num)

# Optimized solution
d,g=list(map(int,input().split()))
ls=[list(map(int,input().split())) for i in range(d)]
P=list([x[0] for x in ls])
C=list([x[1] for x in ls])

tmp=10**9
for i in range(1<<d):
  total=0
  num=0
  for j in range(d):
    if (i>>j)&1:
      total+=C[j]+P[j]*100*(j+1)
      num+=P[j]
  if total>=g:
    tmp=min(num,tmp)
  else:
    for j in range(d-1,-1,-1):
      if (i>>j)&1:
        continue
      for k in range(P[j]):
        if total>=g:
          break
        total+=100*(j+1)
        num+=1
    tmp=min(tmp,num)
print(tmp)