AtCoder Beginner Contest 104 - All Green

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: EASY

Starter code:

Solutions:
(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) = map(int, input().split())
pc = [0] + [list(map(int, input().split())) for _ in range(D)]

def function(G, i):
	if i == 0:
		return 10 ** 9
	n = min(G // (i * 100), pc[i][0])
	s = n * i * 100
	if n == pc[i][0]:
		s += pc[i][1]
	if s < G:
		n += function(G - s, i - 1)
	return min(n, function(G, i - 1))
print(function(G, D))


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()


(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
	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)
	if sum < g:
		use = max(rest)
		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())
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)


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)


(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)


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:
	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
			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()


def dfs(i, sum, count, rem):
	global ans
	if i == D:
		if sum < G:
			k = max(rem)
			n = min(pc[k - 1][0], -(-(G - sum) // (k * 100)))
			count += n
			sum += n * 100 * k
		if sum >= G:
			ans = min(ans, count)
	else:
		dfs(i + 1, sum, count, rem)
		dfs(i + 1, sum + pc[i][0] * 100 * (i + 1) + pc[i][1], count + pc[i][0], rem - {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 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, 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 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)
	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)


(a, b) = map(int, input().split())
c = []
for i in range(a):
	c.append(list(map(int, input().split())))
ans = float('inf')
for i in range(1 << a):
	sc = 0
	co = 0
	for j in range(a):
		if i & 1 << j:
			sc += c[j][0] * (j + 1) * 100 + c[j][1]
			co += c[j][0]
	if sc >= b:
		ans = min(ans, co)
	else:
		for j in range(a)[::-1]:
			if i & 1 << j:
				continue
			else:
				for k in range(c[j][0]):
					sc += 100 * (j + 1)
					co += 1
					if sc >= b:
						break
				if sc >= b:
					break
		ans = min(ans, co)
print(ans)


(D, G) = map(int, input().split())
li = [list(map(int, input().split())) for _ in range(D)][::-1]
ans = float('inf')
for i in range(2 ** D):
	S = 0
	cnt = 0
	q = '{:0>10b}'.format(i)[::-1]
	ads = q.find('0')
	for j in range(D):
		if int(q[j]) & 1:
			S += (D - j) * 100 * li[j][0] + li[j][1]
			cnt += li[j][0]
	if S < G and (D - ads) * 100 * (li[ads][0] - 1) >= G - S:
		for k in range(li[ads][0]):
			S += (D - ads) * 100
			cnt += 1
			if S >= G:
				break
	if S >= G:
		ans = min(ans, cnt)
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)


(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)))
		cnt += n
		score += n * use * 100
	if score >= g:
		ans = min(ans, cnt)
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())
(P, C) = ([0] * d, [0] * d)
for i in range(d):
	(P[i], C[i]) = map(int, input().split())
ans = 10 ** 9
for bin in range(1 << d):
	cnt = tot = rest_max_bit = 0
	for i in range(d):
		if bin & 1 << i:
			t = (i + 1) * 100
			tot += P[i] * t + C[i]
			cnt += P[i]
		else:
			rest_max_bit = i
	if tot < g:
		t = (rest_max_bit + 1) * 100
		p = (g - tot + t - 1) // t
		if p >= P[rest_max_bit]:
			continue
		cnt += p
	ans = min(ans, cnt)
print(ans)


(D, G) = map(int, input().split())
dic1 = {}
dic2 = {}
dic3 = []
min_ans = 10000000000
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) = map(int, input().split())
P = []
C = []
for i in range(D):
	(p, c) = map(int, input().split())
	P.append(p)
	C.append(c)
ans = 10 * 100
for i in range(2 ** D):
	rest = G
	cnt = 0
	maxdgt = -1
	for j in range(D):
		if i & 1 << j:
			rest -= P[j] * (j + 1) * 100 + C[j]
			cnt += P[j]
		else:
			maxdgt = j
	if rest <= 0:
		ans = min(ans, cnt)
	elif rest > (P[maxdgt] - 1) * (maxdgt + 1) * 100:
		continue
	else:
		ans = min(ans, cnt + (rest / 100 - 1) // (maxdgt + 1) + 1)
print(int(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)
v = sum(P)
for i in range(1 << d):
	t = 0
	c = 0
	L = [i for i in range(d)]
	for j in range(d):
		if i & 2 ** j:
			L.remove(j)
			t += (j + 1) * 100 * P[j] + C[j]
			c += P[j]
	if t >= g:
		v = min(v, c)
	elif L:
		s = max(L)
		for k in range(P[s] - 1):
			t += 100 * (s + 1)
			c += 1
			if g <= t:
				v = min(v, c)
				break
print(v)


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

def f(G, i):
	if i == 0:
		return 10000
	n = min(G // (i * 100), L[i][0])
	s = n * i * 100
	if n == L[i][0]:
		s += L[i][1]
	if s < G:
		n += f(G - s, i - 1)
	return min(n, f(G, i - 1))
print(f(G, D))


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

def function(G, i):
	if i == 0:
		return 1000000000.0
	n = min(G // (i * 100), PC[i][0])
	s = n * i * 100
	if n == PC[i][0]:
		s += PC[i][1]
	if s < G:
		n += function(G - s, i - 1)
	return min(n, function(G, i - 1))
print(function(G, D))


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

def fnc(a, b):
	if a == 0:
		return 10 ** 9
	s = min(l[a][0], b // (a * 100))
	t = 100 * a * s
	if s == l[a][0]:
		t += l[a][1]
	if t < b:
		s += fnc(a - 1, b - t)
	return min(s, fnc(a - 1, b))
print(fnc(d, g))


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())
INF = 10 ** 10
n = 2 * 10 ** 5
dp = [INF] * n
dp[0] = 0
for i in range(1, D + 1):
	(p, c) = map(int, input().split())
	c //= 100
	tmp = dp[:]
	for j in range(G // 100 + 1):
		if tmp[j] == INF:
			continue
		for k in range(1, p + 1):
			dp[j + i * k] = min(tmp[j] + k, dp[j + i * k])
		dp[j + i * p + c] = min(tmp[j] + p, dp[j + i * p + c])
ans = INF
for score in dp[G // 100:]:
	if score == INF:
		continue
	ans = min(score, ans)
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)

def f(a, b):
	if a == 0:
		return 10 ** 9
	m = min(b // (a * 100), p[a - 1])
	s = 100 * a * m
	if m == p[a - 1]:
		s += c[a - 1]
	if s < b:
		m += f(a - 1, b - s)
	return min(m, f(a - 1, b))
print(f(D, G))


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]
ans = float('inf')
tmp = 0
for i in range(2 ** d):
	count = 0
	s = 0
	nokori = set(range(1, d + 1))
	for k in range(d):
		if i & 1 << k:
			s += pc[k][0] * (k + 1) * 100 + pc[k][1]
			count += pc[k][0]
			nokori.discard(k + 1)
	if s < g:
		use = max(nokori)
		n = min(pc[use - 1][0], -(-(g - s) // (use * 100)))
		count += n
		s += n * use * 100
	if s >= g:
		ans = min(ans, count)
print(ans)


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 = [0] + [list(map(int, input().split())) for _ in range(D)]

def dfs(i, g):
	if i == 0:
		return 1000000000.0
	m = min(g // (i * 100), PC[i][0])
	s = 100 * i * m
	if m == PC[i][0]:
		s += PC[i][1]
	if s < g:
		m += dfs(i - 1, g - s)
	return min(m, dfs(i - 1, g))
print(dfs(D, G))


([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) = map(int, input().split())
p = []
c = []
for i in range(D):
	(p1, c1) = map(int, input().split())
	p.append(p1)
	c.append(c1)
ans = sum(p)
for i in range(2 ** D):
	num = 0
	point = 0
	flag = [0] * D
	for j in range(D):
		if i >> j & 1:
			num += p[j]
			flag[j] = 1
			point += (j + 1) * 100 * p[j] + c[j]
	if point < G:
		sitt = flag[::-1]
		loc = D - 1 - sitt.index(0)
		k = 0
		while point < G:
			num += 1
			k += 1
			point += (loc + 1) * 100
		if k < p[loc]:
			ans = min(ans, num)
	else:
		ans = min(ans, num)
print(ans)


(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)


(D, G) = map(int, input().split())
PnC = [list(map(int, input().split())) for x in range(D)]
counts = []

def calc(i, count, total, last):
	if G <= total:
		counts.append(count)
		return
	if i >= D:
		for x in range(PnC[last][0]):
			if G <= total + 100 * x * (last + 1):
				counts.append(count + x)
				return
		return
	calc(i + 1, count, total, i)
	calc(i + 1, count + PnC[i][0], total + PnC[i][1] + 100 * (i + 1) * PnC[i][0], last)
calc(0, 0, 0, 0)
print(min(counts))


(d, g) = map(int, input().split())
g //= 100
PC = [list(map(int, input().split())) for _ in range(d)]
(P, C) = zip(*PC)
C = [i // 100 for i in C]
ans = float('inf')
for i in range(2 ** d):
	count = 0
	end = 0
	l = []
	for j in range(d):
		if i >> j & 1:
			count += P[j]
			end += (j + 1) * P[j] + C[j]
		else:
			l += [j + 1] * (P[j] - 1)
	l.sort()
	while end < g and l:
		end += l.pop()
		count += 1
	if end < g:
		continue
	ans = min(ans, count)
print(ans)


(a, b) = map(int, input().split())
c = [0] + [list(map(int, input().split())) for i in range(a)]
print()

def f(t, s):
	if t == 0:
		return 10 ** 9
	l = min(s // (t * 100), c[t][0])
	k = 100 * t * l
	if l == c[t][0]:
		k += c[t][1]
	if k < s:
		l += f(t - 1, s - k)
	return min(l, f(t - 1, s))
print(f(a, b))


(D, G) = map(int, input().split())
p = [0] * int(D)
c = [0] * int(D)
for i in range(D):
	(p[i], c[i]) = map(int, input().split())
ans = 1000000000.0
for i in range(2 ** D):
	s = 0
	num = 0
	rest_max = -1
	for j in range(D):
		if i >> j & 1:
			s += 100 * (j + 1) * p[j] + c[j]
			num += p[j]
		else:
			rest_max = j
	if s < G:
		s1 = 100 * (rest_max + 1)
		need = int((G - s + s1 - 1) / s1)
		if need >= p[rest_max]:
			continue
		num += need
	ans = min(ans, num)
print(ans)


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):
	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))


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

def f(d, g):
	if 0 > d:
		return 100 ** 10
	n = min(g // (100 * (d + 1)), PC[d][0])
	s = n * 100 * (d + 1)
	if n == PC[d][0]:
		s += PC[d][1]
	if g > s:
		n += f(d - 1, g - s)
	return min(n, f(d - 1, g))

def main():
	print(f(D - 1, G))
main()


(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 = sum(p)
for i in range(1 << d):
	a = []
	cnt = 0
	pt = 0
	for j in range(d):
		if i >> j & 1:
			pt += p[j] * (j + 1) * 100 + c[j]
			cnt += p[j]
		else:
			a += [(p[j], j + 1)]
	if pt < g:
		(j, k) = a[-1]
		cnt += (g - pt + k * 100 - 1) // (k * 100)
		pt += k * 100 * j
	if pt >= g:
		ans = min(ans, cnt)
print(ans)


(D, G) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(D)]
res = 1 << 29
for bit in range(1 << D):
	ans = 0
	num = 0
	for j in range(D):
		if bit & 1 << j:
			ans += pc[j][0] * (j + 1) * 100 + pc[j][1]
			num += pc[j][0]
	if ans >= G:
		res = min(num, res)
	else:
		for j in range(D - 1, -1, -1):
			if bit & 1 << j:
				continue
			else:
				for i in range(pc[j][0]):
					if ans >= G:
						break
					ans += 100 * (j + 1)
					num += 1
		res = min(num, res)
print(res)


def i1():
	return int(input())

def i2():
	return [int(i) for i in input().split()]
[d, g] = i2()
e = [0 for i in range(1001)]
for i in range(1, d + 1):
	[p, c] = i2()
	ee = e[:]
	for j in range(p - 1):
		for k in range(1000)[::-1]:
			if e[k] > 0 or k == 0:
				e[k + 1] = max(e[k + 1], e[k] + 100 * i)
	for k in range(1001 - p)[::-1]:
		if ee[k] > 0 or k == 0:
			ee[k + p] = max(ee[k + p], ee[k] + 100 * i * p + c)
			e[k + p] = max(e[k + p], ee[k + p])
for i in range(1001):
	if e[i] >= g:
		print(i)
		break


(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):
	al = []
	notal = []
	anstmp = 0
	score = 0
	for j in range(d):
		if i >> j & 1:
			al.append(j)
		else:
			notal.append(j)
	for j in al:
		score += (j + 1) * 100 * pc[j][0]
		score += pc[j][1]
		anstmp += pc[j][0]
	while notal and score < g:
		j = notal.pop()
		k = (g - score + (j + 1) * 100 - 1) // ((j + 1) * 100)
		k = min(k, pc[j][0] - 1)
		score += (j + 1) * 100 * k
		anstmp += k
	if score >= g:
		ans = min(ans, anstmp)
print(ans)


(D, G) = map(int, input().split())
P = []
num_p = 0
for i in range(1, D + 1):
	(p, c) = map(int, input().split())
	num_p += p
	for j in range(1, p + 1):
		P += [(j, i * 100 * j + c * (j == p))]
dp = [0] * (num_p + 1)
for (k, pt) in P:
	if k == 1:
		t_dp = dp[:]
	for cur in range(1, num_p + 1):
		if cur >= k:
			dp[cur] = max(dp[cur], t_dp[cur - k] + pt)
for i in range(num_p + 1):
	if dp[i] >= G:
		print(i)
		break


(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 = float('inf')
for bit in range(2 ** D):
	wa = 0
	cnt = 0
	for i in range(D):
		if bit & 1 << i:
			wa += (i + 1) * 100 * P[i] + C[i]
			cnt += P[i]
	for i in range(D - 1, -1, -1):
		if wa >= G:
			break
		if bit & 1 << i:
			continue
		s = (i + 1) * 100
		need = (G - wa + s - 1) // s
		wa += min(need, P[i]) * s
		cnt += min(need, P[i])
	if wa >= G:
		ans = min(ans, cnt)
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)


(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)

def f(p, c):
	if p == 0:
		return 10 ** 9
	m = min(c // (p * 100), P[p - 1])
	s = 100 * p * m
	if m == P[p - 1]:
		s += C[p - 1]
	if s < c:
		m += f(p - 1, c - s)
	return min(m, f(p - 1, c))
print(f(d, g))


(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 = [0] + [[i for i in map(int, input().split())] for i in range(d)]

def dfs(g, i):
	if i == 0:
		return 10 ** 12
	cnt = min(g // (100 * i), PC[i][0])
	score = cnt * 100 * i
	if cnt == PC[i][0]:
		score += PC[i][1]
	if g > score:
		cnt += dfs(g - score, i - 1)
	return min(cnt, dfs(g, i - 1))
print(dfs(g, d))


(D, G) = map(int, input().split())
s = 0
Q = []
for i in range(D):
	(p, c) = map(int, input().split())
	s += p
	Q.append((i + 1, p, c))
dp = [-10 ** 18] * (s + 1)
dp[0] = 0
for (i, p, c) in Q:
	for j in range(s, -1, -1):
		for k in range(1, p + 1):
			if k == p:
				cc = 100 * i * k + c
			else:
				cc = 100 * i * k
			if j - k >= 0:
				dp[j] = max(dp[j], dp[j - k] + cc)
for i in range(1 + s):
	if dp[i] >= G:
		print(i)
		break


(d, g) = map(int, input().split())
PC = [list(map(int, input().split())) for i in range(d)]
P = list(map(lambda x: x[0], PC))
C = list(map(lambda x: x[1], PC))
ans = 10 ** 9

def dfs(cur, target):
	if cur == 0:
		return 10 ** 9
	cnt = min(target // (cur * 100), P[cur - 1])
	tmp = 100 * cur * cnt
	if cnt == P[cur - 1]:
		tmp += C[cur - 1]
	if tmp < target:
		cnt += dfs(cur - 1, target - tmp)
	return min(cnt, dfs(cur - 1, target))
print(dfs(d, g))


import itertools
import math
(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]
a = [i for i in range(d)]
b = itertools.permutations(a, d)
ans = float('inf')
for x in b:
	c = 0
	e = 0
	flag = False
	for i in x:
		if e + 100 * (i + 1) * pc[i][0] <= g:
			c += pc[i][0]
			e += 100 * (i + 1) * pc[i][0] + pc[i][1]
			if e >= g:
				break
		else:
			c += math.ceil((g - e) / (100 * (i + 1)))
			break
	ans = min(ans, c)
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))


(D, G) = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(D)]
ans = 0
for i in range(1 << D):
	point = 0
	count = 0
	for j in range(D):
		if i >> j & 1:
			point += 100 * (j + 1) * X[j][0] + X[j][1]
			count += X[j][0]
	if G > point:
		for k in range(D)[::-1]:
			if i >> k & 1 == 0:
				if G - point <= 100 * (k + 1) * (X[k][0] - 1):
					count += -(-(G - point) // (100 * (k + 1)))
					break
				else:
					count = 10 ** 5
					break
	if ans == 0 or count < ans:
		ans = count
print(ans)


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

def dfs(d, g):
	if d == 0:
		return 1000000000.0
	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))


(D, G) = map(int, input().split())
Q = list()
s = 0
for d in range(D):
	Q.append([d + 1] + [int(x) for x in input().split()])
	s += Q[-1][1]
dp = [-float('inf')] * (s + 1)
dp[0] = 0
for (i, p, c) in Q:
	for j in range(s, -1, -1):
		for k in range(1, p + 1):
			if k == p:
				cc = 100 * i * k + c
			else:
				cc = 100 * i * k
			if k <= j:
				dp[j] = max(dp[j], dp[j - k] + cc)
for i in range(s + 1):
	if dp[i] >= G:
		print(i)
		exit()


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\n3 500\n5 800'
		output = '3'
		self.assertIO(input, output)

	def test_入力例_2(self):
		input = '2 2000\n3 500\n5 800'
		output = '7'
		self.assertIO(input, output)

	def test_入力例_3(self):
		input = '2 400\n3 500\n5 800'
		output = '2'
		self.assertIO(input, output)

	def test_入力例_4(self):
		input = '5 25000\n20 1000\n40 1000\n50 1000\n30 1000\n1 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():
	resolve()
__starting_point()


(D, G) = map(int, input().split())
PC = [0] + [tuple(map(int, input().split())) for _ in range(D)]
SHORT_OF_SCORE = 10 ** 9

def solve(p, g):
	if p == 0:
		return SHORT_OF_SCORE
	case_solve_p = min(g // (p * 100), PC[p][0])
	reward = 100 * p * case_solve_p + (PC[p][1] if case_solve_p == PC[p][0] else 0)
	if reward < g:
		case_solve_p += solve(p - 1, g - reward)
	case_not_solve_p = solve(p - 1, g)
	return min(case_solve_p, solve(p - 1, g))
print(solve(D, G))


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()


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

def bfs(i, solve, sum, n):
	if i == d:
		if sum >= g:
			global ans
			ans = min(ans, solve)
		elif (pc[n][0] - 1) * (n + 1) * 100 >= g - sum:
			if (g - sum) % ((n + 1) * 100) == 0:
				plus = (g - sum) // ((n + 1) * 100)
			else:
				plus = (g - sum) // ((n + 1) * 100) + 1
			ans = min(ans, solve + plus)
	else:
		bfs(i + 1, solve + pc[i][0], sum + pc[i][0] * (i + 1) * 100 + pc[i][1], n)
		bfs(i + 1, solve, sum, i)
bfs(0, 0, 0, 0)
print(ans)


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())
p = [0] * (D + 1)
c = [0] * (D + 1)
for i in range(1, D + 1):
	(p[i], c[i]) = map(int, input().split())
ans = float('inf')

def dfs(i, g):
	global ans
	if i == 0:
		return ans
	cnt = min(g // (100 * i), p[i])
	score = 100 * i * cnt
	if cnt == p[i]:
		score += c[i]
	if g > score:
		cnt += dfs(i - 1, g - score)
	return min(cnt, dfs(i - 1, g))
print(dfs(D, G))


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

def dfs(g, i):
	if i == 0:
		return 10 ** 12
	n = min(g // (100 * i), pc[i][0])
	score = n * 100 * i
	if n == pc[i][0]:
		score += pc[i][1]
	if g > score:
		n += dfs(g - score, i - 1)
	return min(n, dfs(g, i - 1))
print(dfs(g, d))


(d, g) = map(int, input().split())
g //= 100
p = [0] * d
c = [0] * d
for i in range(d):
	(x, y) = map(int, input().split())
	p[i] = x
	c[i] = y // 100
ans = sum(p)
for bit in range(1 << d):
	t = -1
	cur = 0
	ret = 0
	for i in range(d):
		if bit & 1 << i:
			cur += p[i] * (i + 1) + c[i]
			ret += p[i]
		else:
			t = i
	if cur >= g:
		if ans > ret:
			ans = ret
	else:
		h = (g - cur - 1) // (t + 1) + 1
		if h <= p[t]:
			ret += h
			if ret < ans:
				ans = ret
print(ans)


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
m = 10000
for i in range(2 ** d):
	cur = bin(i)[2:].zfill(d)
	s = 0
	c = 0
	nu = []
	for i in range(d):
		if cur[i] == '0':
			nu.append(i)
		else:
			s += (i + 1) * 100 * pc[i][0] + pc[i][1]
			c += pc[i][0]
	if g > s:
		if g - s <= (nu[-1] + 1) * 100 * pc[nu[-1]][0]:
			c += (g - s - 1) // ((nu[-1] + 1) * 100) + 1
			m = min(c, m)
	else:
		m = min(c, m)
print(m)


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 = []
	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
		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()


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)


(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 = 1000000000.0
for mask in range(2 ** D):
	score = 0
	num = 0
	rest_max = -1
	for i in range(D):
		if mask >> i & 1:
			score += 100 * (i + 1) * P[i] + C[i]
			num += P[i]
		else:
			rest_max = i
	if score < G:
		scr1 = 100 * (rest_max + 1)
		need = (G - score + scr1 - 1) // scr1
		if need >= P[rest_max]:
			continue
		num += need
	ans = min(ans, num)
print(ans)


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

def solve(g, i):
	if i == -1:
		return 100000
	n = min(g // (100 * (i + 1)), pc[i][0])
	s = n * (i + 1) * 100
	if n == pc[i][0]:
		s += pc[i][1]
	if g - s > 0:
		n += solve(g - s, i - 1)
	return min(n, solve(g, i - 1))
print(solve(g, d - 1))


(D, G) = map(int, input().split())
l = []
(P, C) = ([], [])
for _ in range(D):
	(p, c) = map(int, input().split())
	P.append(p)
	C.append(c)
ans = 10 ** 10
for mask in range(int(bin(1 << D), 0)):
	s = 0
	num = 0
	rest_max = -1
	for i in range(D):
		if mask >> i & 1:
			s += 100 * (i + 1) * P[i] + C[i]
			num += P[i]
		else:
			rest_max = i
	if s < G:
		s1 = 100 * (rest_max + 1)
		need = (G - s + s1 - 1) // s1
		if need >= P[rest_max]:
			continue
		num += need
	ans = min(ans, num)
print(ans)


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

def all_green(t, s):
	if t == -1:
		return float('inf')
	num = min(PC[t][0], s // (100 * (t + 1)))
	k = num * 100 * (t + 1)
	if num == PC[t][0]:
		k += PC[t][1]
	if k < s:
		num += all_green(t - 1, s - k)
	return min(num, all_green(t - 1, s))
print(all_green(D - 1, G))


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

def f(G, i):
	if i == 0:
		return float('inf')
	n = min(G // (i * 100), pc[i][0])
	s = n * i * 100
	if n == pc[i][0]:
		s += pc[i][1]
	if s < G:
		n += f(G - s, i - 1)
	return min(n, f(G, i - 1))
print(f(G, D))


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
	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)


(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]
	elif nkanli == []:
		continue
	else:
		for k in range(len(nkanli) - 1, -1, -1):
			if nkanli[k] in pe:
				continue
			elif kari + poli[nkanli[k]][-2] >= g:
				karimon += math.ceil((g - kari) / (nkanli[k] + 1))
				numli += [karimon]
				break
			else:
				break
print(min(numli))


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

def solve(goal, d):
	if d == 0:
		return 10 ** 9
	n = min(goal // (100 * d), pc[d][0])
	t = n * d * 100
	if n == pc[d][0]:
		t += pc[d][1]
	if t < goal:
		n += solve(goal - t, d - 1)
	return min(n, solve(goal, d - 1))
print(solve(goal, d))


(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)


(d, g) = map(int, input().split())
p = []
c = []
for i in range(d):
	(a, b) = map(int, input().split())
	p.append(a)
	c.append(b)
sum = []
for i in range(d):
	sum.append((i + 1) * 100 * p[i] + c[i])

def ans(g, t):
	if t <= 0:
		return 100000000000
	n = min(int(g / (100 * t)), p[t - 1])
	s = 100 * t * n
	if n == p[t - 1]:
		s = sum[t - 1]
	if g > s:
		n += ans(g - s, t - 1)
	return min(n, ans(g, t - 1))
print(ans(g, d))


(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 = 10 ** 6
for i in range(2 ** d):
	cnt = 0
	sum = 0
	k = -1
	for j in range(d):
		if i >> j & 1:
			sum += (j + 1) * 100 * p[j] + c[j]
			cnt += p[j]
		else:
			k = j
	if sum < g:
		s1 = 100 * (k + 1)
		need = (g - sum + s1 - 1) // s1
		if need >= p[k]:
			continue
		cnt += need
	ans = min(ans, cnt)
print(ans)


(d, g) = map(int, input().split())
p = []
c = []
for l in range(d):
	(t1, t2) = map(int, input().split())
	p.append(t1)
	c.append(t2)
ans = 1000000000.0
for i in range(1 << d):
	s = 0
	n = 0
	r = -1
	for j in range(d):
		if i >> j & 1:
			s += 100 * (j + 1) * p[j] + c[j]
			n += p[j]
		else:
			r = j
	if s < g:
		s1 = 100 * (r + 1)
		ne = (g - s + s1 - 1) // s1
		if ne >= p[r]:
			continue
		n += ne
	ans = min(ans, n)
print(ans)


(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):
	sum = 0
	cnt = 0
	rem = 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]
			rem.discard(i)
	if sum < g:
		u = max(rem)
		n = min(pc[u][0], -(-(g - sum) // ((u + 1) * 100)))
		cnt += n
		sum += n * (u + 1) * 100
	if sum >= g:
		ans = min(ans, cnt)
print(ans)


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

def function(g, i):
	if i == 0:
		return 1000000000.0
	n = min(g // (i * 100), p_c[i][0])
	s = n * i * 100
	if n == p_c[i][0]:
		s += p_c[i][1]
	if s < g:
		n += function(g - s, i - 1)
	return min(n, function(g, i - 1))
print(function(g, d))


from math import ceil
(D, G) = map(int, input().split())
(p, c) = ([0] * D, [0] * D)
for i in range(D):
	(p[i], c[i]) = map(int, input().split())
m = 0
mondai = []
for i in range(2 ** D, 2 ** (D + 1)):
	s = bin(i)[3:]
	(a, b) = (0, 0)
	for j in range(D):
		if s[j] == '1':
			(a, b) = (a + p[j], b + 100 * (j + 1) * p[j] + c[j])
		else:
			m = j
	if G <= b:
		mondai.append(a)
	if G - p[m] * 100 * (m + 1) < b < G:
		ad = ceil((G - b) / (100 * (m + 1)))
		mondai.append(a + ad)
print(min(mondai))


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = 1001
for i in range(1 << d):
	(count, score, left) = (0, 0, 0)
	for j in range(d):
		if i >> j & 1:
			score += (j + 1) * 100 * pc[j][0] + pc[j][1]
			count += pc[j][0]
		else:
			left = j
	add = min(-(-max(g - score, 0) // ((left + 1) * 100)), pc[left][0])
	count += add
	score += (left + 1) * 100 * add
	if score >= g:
		ans = min(ans, count)
print(ans)


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

def solve(G, i):
	if i <= 0:
		return float('inf')
	n = min(int(G / (100 * i)), PC[i - 1][0])
	score = 100 * i * n
	if n == PC[i - 1][0]:
		score += PC[i - 1][1]
	if G > score:
		n += solve(G - score, i - 1)
	return min(n, solve(G, i - 1))
print(solve(G, D))


(D, G) = list(map(int, input().split()))
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)


(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)]
	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)


import math

def get_input() -> 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:
	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())
l = [list(map(int, input().split())) for i in range(d)]

def f(t, s):
	if t == -1:
		return float('inf')
	num = min(l[t][0], s // ((t + 1) * 100))
	k = num * (t + 1) * 100
	if num == l[t][0]:
		k += l[t][1]
	if k < s:
		num += f(t - 1, s - k)
	return min(num, f(t - 1, s))
print(f(d - 1, g))


(n, g) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(n)]
p = [pc[i][0] for i in range(n)]
c = [pc[i][0] * (i + 1) * 100 + pc[i][1] for i in range(n)]
ans = 1e+18
for i in range(1 << n):
	sm = cnt = idx = 0
	for j in range(n):
		if i >> j & 1:
			sm += c[j]
			cnt += p[j]
		else:
			idx = j + 1
	if g - sm > 0:
		tmp = (g - sm + idx * 100 - 1) // (idx * 100)
		if 0 <= tmp <= p[idx - 1]:
			ans = min(ans, cnt + tmp)
	else:
		ans = min(ans, cnt)
print(ans)


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

def f(i, t):
	if i == 0 or i > D:
		return 10 ** 9
	k = min(t // (100 * i), PC[i][0])
	s = 100 * i * k
	if k == PC[i][0]:
		s += PC[i][1]
	if s < t:
		k += f(i - 1, t - s)
	return min(k, f(i - 1, t))
print(f(D, G))


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()


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()


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

def f(p, c):
	if p == 0:
		return 10 ** 9
	m = min(c // (p * 100), PC[p][0])
	s = 100 * p * m
	if m == PC[p][0]:
		s += PC[p][1]
	if s < c:
		m += f(p - 1, c - s)
	return min(m, f(p - 1, c))
print(f(D, G))


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

def f(g, i):
	if i == -1:
		return 10000000
	n = min(g // ((i + 1) * 100), point[i][0])
	s = n * (i + 1) * 100
	if n == point[i][0]:
		s += point[i][1]
	if s < g:
		n += f(g - s, i - 1)
	return min(n, f(g, i - 1))
print(f(g, d - 1))


import math
(D, G) = [int(s) for s in input().split()]
ls = [[int(s) for s in input().split()] for i in range(D)]
maxD = 2 ** D - 1

def need(num):
	val = num
	score = 0
	prob = 0
	for i in range(D):
		if val % 2 == 1:
			score += ls[i][0] * (i + 1) * 100 + ls[i][1]
			prob += ls[i][0]
		val //= 2
	if score >= G:
		return prob
	else:
		k = int(math.log2(num ^ maxD))
		x = (score - G) // ((k + 1) * 100)
		if -x <= ls[k][0]:
			return -x + prob
		else:
			return 10000
print(min([need(i) for i in range(2 ** D)]))


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) = map(int, input().split())
LC = []
LB = []
for i in range(d):
	(c, b) = map(int, input().split())
	LC.append(c)
	LB.append(b)
ans = sum(LC)
for i in range(1 << d):
	P = 0
	c = 0
	n = -1
	for j in range(d):
		if i & 1 << j:
			P += (j + 1) * 100 * LC[j] + LB[j]
			c += LC[j]
		else:
			n = max(n, j)
	if P >= g:
		ans = min(ans, c)
	elif n != -1:
		for k in range(LC[n] - 1):
			P += (n + 1) * 100
			c += 1
			if P >= g:
				ans = min(ans, c)
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())
pl = [0] * D
cl = [0] * D
for i in range(D):
	(pl[i], cl[i]) = map(int, input().split())
ans = []
for bit in range(2 ** D):
	compl = []
	count = 0
	score = 0
	for i in range(D):
		if bit & 1 << i:
			score += pl[i] * 100 * (i + 1) + cl[i]
			count += pl[i]
			compl.append(i)
	if score >= G:
		ans.append(count)
	else:
		n = max(set(range(D)) - set(compl))
		for i in range(pl[n]):
			score += 100 * (n + 1)
			count += 1
			if score >= G:
				ans.append(count)
				break
print(min(ans))


(D, G) = map(int, input().split())
P = [list(map(int, input().split())) for d in range(D)]
ans = 1000
for i in range(1 << D):
	s = 0
	n = 0
	for j in range(D):
		if i >> j & 1 == 1:
			s += 100 * (j + 1) * P[j][0] + P[j][1]
			n += P[j][0]
	for j in range(D - 1, -1, -1):
		if i >> j & 1 == 0:
			r = ((G - s) // 100 + j) // (j + 1)
			if r > P[j][0]:
				n = 1000
			else:
				n += max(r, 0)
			break
	ans = min(ans, n)
print(ans)


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

def dfs(i, g):
	if i == 0:
		return 10 ** 9
	c = min(g // (i * 100), L[i][0])
	n = 100 * i * c
	if c == L[i][0]:
		n += L[i][1]
	if n < g:
		c += dfs(i - 1, g - n)
	return min(c, dfs(i - 1, g))
print(dfs(D, G))


import math
(d, g) = map(int, input().split())
pc = [[int(i) for i in input().split()] for _ in range(d)]
a = 1000
for i in range(2 ** d):
	c = 0
	s = 0
	m = 0
	for j in range(d):
		if i >> j & 1:
			s += (j + 1) * 100 * pc[j][0] + pc[j][1]
			c += pc[j][0]
		else:
			m = j
	if s >= g:
		a = min(a, c)
	elif (m + 1) * 100 * (pc[m][0] - 1) + s >= g:
		a = min(a, c + math.ceil((g - s) / ((m + 1) * 100)))
print(a)


((d, g), *s) = [list(map(int, i.split())) for i in open(0)]
s = [[i[0] * -~n * 100 + i[1], i[0]] for (n, i) in enumerate(s)]
a = 10 ** 3
for b in range(1 << d):
	su = sum((s[i][0] * (b >> i & 1) for i in range(d)))
	n = sum((s[i][1] * (b >> i & 1) for i in range(d)))
	if su < g:
		m = d - bin(b)[2:].zfill(d).find('0')
		e = (su - g) // (m * 100)
		if -e < s[m - 1][1]:
			a = min(a, n - e)
	if su >= g:
		a = min(a, n)
print(a)


(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)


(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)


import math
(D, G) = map(int, input().split())
p = [0] * D
c = [0] * D
ans = float('inf')
for i in range(D):
	(p[i], c[i]) = map(int, input().split())
for i in range(2 ** D):
	s = 0
	n = 0
	ma = -1
	for j in range(D):
		if i >> j & 1 == 1:
			s += 100 * (j + 1) * p[j] + c[j]
			n += p[j]
		else:
			ma = j
	if s < G:
		m = math.ceil((G - s) / (100 * (ma + 1)))
		if m > p[ma]:
			continue
		else:
			n += m
	ans = min(ans, n)
print(ans)


(d, g) = map(int, input().split())
lst = []
for _ in range(d):
	lst.append([int(i) for i in input().split()])
res = 1000
for i in range(1 << d):
	s = 0
	c = 0
	for j in range(d):
		if i >> j & 1:
			s += 100 * (j + 1) * lst[j][0] + lst[j][1]
			c += lst[j][0]
		else:
			last = j
	if s < g:
		s100 = 100 * (last + 1)
		need = (g - s - 1) // s100 + 1
		if need > lst[last][0]:
			continue
		c += need
	if res > c:
		res = c
print(res)


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()


(d, g) = map(int, input().split())
a = [tuple(map(int, input().split())) for _ in range(d)]
r = float('inf')
for b in range(1 << d):
	x = n = 0
	j = -1
	for i in range(d):
		if b & 1 << i:
			(p, c) = a[i]
			x += p * (i + 1) * 100 + c
			n += p
		else:
			j = i
	if j != -1:
		(p, c) = a[j]
		y = 100 * (j + 1)
		m = max(0, g - x + y - 1) // y
		if m < p:
			x += m * y + c
			n += m
	if x >= g:
		r = min(r, n)
print(r)


(D, G) = map(int, input().split())
PC = [list(map(int, input().split())) for _ in range(D)]
ans = 1000000000.0
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)


(d, g) = map(int, input().split())
p = [0] * (d + 1)
c = [0] * (d + 1)
for i in range(1, d + 1):
	(p[i], c[i]) = map(int, input().split())
m = sum(p)
for x in range(2 ** d - 1):
	b = str(format(x, '010b'))
	s = 0
	y = 0
	for i in range(1, d + 1):
		if b[-i] == '1':
			s += 100 * i * p[i] + c[i]
			y += p[i]
		else:
			a = i
	if g <= s:
		m = min(m, y)
	elif g <= s + 100 * a * p[a]:
		m = min(m, y + (g - s + 100 * (a - 1)) // (100 * a))
print(m)


(d, g) = map(int, input().split())
s = [list(map(int, input().split())) for _ in range(d)]
from itertools import product
ans = 10000
for b in product([0, 1], repeat=d):
	t = 0
	sc = 0
	mi = 0
	for i in range(d):
		if b[i]:
			t += s[i][0]
			sc += s[i][1] + (i + 1) * 100 * s[i][0]
		else:
			mi = i
	z = -(-max(0, g - sc) // ((mi + 1) * 100))
	if z > s[mi][0] - 1:
		continue
	ans = min(ans, t + z)
print(ans)


import sys
inp = sys.stdin.readline
(D, G) = map(int, inp().split())
PC = [list(map(int, inp().split())) for _ in range(D)]
ans = 10 ** 9 + 7
result = []
for i in range(1 << D):
	point = 0
	cnt = 0
	tmp = []
	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.append(j)
	if point < G:
		r = G - point
		k = tmp[-1]
		if (PC[k][0] - 1) * (k + 1) * 100 < r:
			continue
		cnt += -(-r // (100 * (k + 1)))
	ans = min(ans, cnt)
print(ans)


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)]
	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
	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)]

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(' '))
p = [0] * D
c = [0] * D
for i in range(D):
	(p[i], c[i]) = map(int, input().split(' '))

def solve(G, i):
	if i <= 0:
		return 1000000000.0
	n = min(int(G / (100 * i)), p[i - 1])
	s = 100 * i * n
	if n == p[i - 1]:
		s += c[i - 1]
	if G > s:
		n += solve(G - s, i - 1)
	return min(n, solve(G, i - 1))
print(solve(G, D))


from itertools import permutations
(d, g) = map(int, input().split())
g = g // 100
p = []
c = []
for _ in range(d):
	(pp, cc) = map(int, input().split())
	p.append(pp)
	c.append(cc // 100)
ans = float('inf')
for array in permutations(range(d)):
	gap = g
	num = 0
	for a in array:
		if p[a] * (a + 1) >= gap:
			num += (gap - 1) // (a + 1) + 1
			break
		elif p[a] * (a + 1) + c[a] >= gap:
			num += p[a]
			break
		else:
			num += p[a]
			gap -= p[a] * (a + 1) + c[a]
	if num < ans:
		ans = num
print(ans)


import sys
input = sys.stdin.readline
f = lambda : map(int, input().split())
(d, g) = f()
g //= 100
ll = []
for i in range(d):
	(p, c) = f()
	ll.append([i + 1, p, c // 100])
ll = ll[::-1]
import itertools as it
ans = 10 ** 9
for t in it.product(range(2), repeat=d):
	cnt = 0
	tot = 0
	flg = 1
	lg = [1, 0]
	for (i, b) in enumerate(t):
		(u, p, c) = ll[i]
		if b:
			cnt += p
			tot += u * p + c
		elif flg:
			lg = [u, p]
			flg = 0
	if g <= tot + lg[0] * lg[1]:
		ans = min(ans, cnt + max(g - tot, 0) // lg[0])
print(max(ans, 1))


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())
p = [0 for _ in range(d)]
c = [0 for _ in range(d)]
ans = 100 ** 10
for i in range(d):
	(p[i], c[i]) = map(int, input().split())
for i in range(2 ** d):
	score = 0
	count = 0
	horyu = 0
	for j in range(d):
		if i >> j & 1:
			score += (j + 1) * p[j] * 100 + c[j]
			count += p[j]
		else:
			horyu = j
	for i in range(p[horyu]):
		if score >= g and count < ans:
			ans = count
		score += (horyu + 1) * 100
		count += 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 = 1 << 60
for bit in range(1 << D):
	s = 0
	num = 0
	rest_max = -1
	for i in range(D):
		if bit & 1 << i:
			s += 100 * (i + 1) * P[i] + C[i]
			num += P[i]
		else:
			rest_max = i
	if s < G:
		rest_max_point = 100 * (rest_max + 1)
		need = -(-(G - s) // rest_max_point)
		if need < P[rest_max]:
			num += need
		else:
			continue
	ans = min(ans, num)
print(ans)


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in [0] * d]
ans = []
for mask in range(1 << d):
	s = 0
	num = 0
	rest_max = -1
	for i in range(d):
		(p, c) = pc[i]
		if mask >> i & 1:
			s += p * 100 * (i + 1) + c
			num += p
		else:
			rest_max = i
	if s < g:
		s1 = 100 * (rest_max + 1)
		need = (g - s + s1 - 1) // s1
		if need >= pc[rest_max][0]:
			continue
		num += need
	ans.append(num)
print(min(ans))


from itertools import combinations
(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 = 100 * 10
for i in range(0, D + 1):
	for v in combinations(range(D), i):
		t = 0
		s = 0
		for j in v:
			t += p[j]
			s += p[j] * (j + 1) * 100 + c[j]
		if s < G:
			for j in range(D)[::-1]:
				if j in v:
					pass
				else:
					k = (G - s) // ((j + 1) * 100)
					t += min(p[j] - 1, k)
					s += min(p[j] - 1, k) * (j + 1) * 100
					if s >= G:
						break
		if s >= G:
			ans = min(ans, t)
print(ans)


(d, g) = map(int, input().split())
l = list((list(map(int, input().split())) for i in range(d)))
ans = 10 ** 7
for bit in range(1 << d):
	count = 0
	sum = 0
	nokori = set(range(1, d + 1))
	for j in range(d):
		if bit & 1 << j:
			count += l[d - j - 1][0]
			sum += l[d - j - 1][0] * 100 * (d - j) + l[d - j - 1][1]
			nokori.discard(d - j)
	if sum < g:
		use = max(nokori)
		n = min(l[use - 1][0] - 1, -(-(g - sum) // (100 * use)))
		count += n
		sum += 100 * use * n
	if sum >= g:
		ans = min(ans, count)
print(ans)


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


(d, G) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(d)]
ans = 1000
for i in range(2 ** d):
	g = 0
	t = 0
	ncp = [1, 0]
	for j in range(d):
		if i >> j & 1:
			g += l[j][0] * (j + 1) * 100 + l[j][1]
			t += l[j][0]
		else:
			ncp = [(j + 1) * 100, l[j][0]]
	t += max(min(-(-(G - g) // ncp[0]), ncp[1]), 0)
	g += max(min(-(-(G - g) // ncp[0]), ncp[1]), 0) * ncp[0]
	if g >= G:
		ans = min(ans, t)
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):
	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)


import math
(D, G) = [int(x) for x in input().split()]
P = [[int(x) for x in input().split()] for i in range(D)]
min_ = 100000000.0
for bit in range(2 ** D):
	score = 0
	n_solved = 0
	rest = -1
	for i in range(D):
		if bit >> i & 1:
			score += (i + 1) * 100 * P[i][0] + P[i][1]
			n_solved += P[i][0]
		else:
			rest = i
	if G > score:
		s1 = 100 * (rest + 1)
		need = (G - score + s1 - 1) // s1
		if need >= P[rest][0]:
			continue
		n_solved += need
	min_ = min(min_, n_solved)
print(min_)


(D, G) = map(int, input().split())
G //= 100
dp = [[0 for i in range(1105)] for i in range(12)]
for i in range(1, D + 1):
	(p, c) = map(int, input().split())
	c //= 100
	for j in range(1005):
		for k in range(p):
			dp[i][j + k] = max(dp[i][j + k], dp[i - 1][j] + k * i)
		dp[i][j + p] = max(dp[i][j + p], dp[i - 1][j] + p * i + c)
for i in range(1001):
	if dp[D][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)


from math import ceil
(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())
_min = 101 * D
flag = 0
while flag < 2 ** D:
	_G = G
	tmp = 0
	max_ind = 0
	for i in range(D):
		if flag & 1 << i:
			_G -= p[i] * (i + 1) * 100 + c[i]
			tmp += p[i]
		else:
			max_ind = i
	k = ceil(max([_G, 0]) / (100 * (max_ind + 1)))
	if k < p[max_ind] or k == 0:
		tmp += k
		_min = min([tmp, _min])
	flag += 1
print(_min)


I = lambda : map(int, input().split())
(D, G) = I()
P = {}
C = {}
S = {}
R = range(D)
for i in R:
	(P[i], C[i]) = I()
	S[i] = -~i * 100 * P[i] + C[i]
r = 1000000000.0 + 7
for k in range(1 << D):
	h = str(bin(k))[2:].rjust(D, '0')
	p = 0
	s = 0
	for i in R:
		if h[i] == '1':
			p += P[i]
			s += S[i]
	if s >= G:
		r = min(r, p)
		continue
	for i in R[::-1]:
		j = -~i * 100
		if h[i] == '0' and G - s < j * P[i]:
			r = min(r, p + (G - s + j - 1) // j)
			break
print(r)


(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 = float('inf')
for bit in range(1 << d):
	sum = 0
	count = 0
	nokori = set(range(1, d + 1))
	for i in range(d):
		if bit & 1 << i:
			sum += p[i] * 100 * (i + 1) + c[i]
			count += p[i]
			nokori.discard(i + 1)
	if sum < g:
		a = g - sum
		num = max(nokori)
		n = min(p[num - 1], -(-a // (num * 100)))
		count += n
		sum += n * num * 100
	if sum >= g:
		ans = min(ans, count)
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)


import sys
sys.setrecursionlimit(10 ** 8)

def dfs(i, sum, count, nokori):
	global ans
	if i == d:
		if sum < g:
			use = max(nokori)
			n = min(pc[use - 1][0], -(-(g - sum) // (100 * use)))
			count += n
			sum += n * 100 * use
		if sum >= g:
			ans = min(ans, count)
	else:
		dfs(i + 1, sum, count, nokori)
		dfs(i + 1, sum + pc[i][0] * 100 * (i + 1) + 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 = [[int(i) for i in input().split()] for j in range(d)]
v = g // 100 + 1
for i in range(2 ** d):
	c = m = s = 0
	for j in range(d):
		if i & 2 ** j > 0:
			s += p[j][0] * (j + 1) * 100 + p[j][1]
			c += p[j][0]
		else:
			m = j
		if s >= g:
			v = min(v, c)
		elif s + (p[m][0] - 1) * (m + 1) * 100 >= g:
			v = min(v, c + (g - s + 100 * (m + 1) - 1) // (100 * (m + 1)))
print(v)


from itertools import combinations
inf = 1 << 30
(d, g) = [int(x) for x in input().split()]
(p, c) = zip(*[[int(x) for x in input().split()] for _ in range(d)])

def n_prob(l):
	t = sum([p[i] * (i + 1) * 100 + c[i] for i in l])
	n = sum([p[i] for i in l])
	if t < g:
		for j in range(d - 1, -1, -1):
			if j not in l:
				if t + p[j] * (j + 1) * 100 >= g:
					n += (g - t + (j + 1) * 100 - 1) // ((j + 1) * 100)
					return n
		return inf
	return n
print(min([n_prob(l) for x in range(d + 1) for l in combinations(range(d), x)]))


(D, G) = map(int, input().split())
iPC = [None] * D
S = list(range(D))
for i in range(D):
	(p, c) = map(int, input().split())
	iPC[i] = [p, 100 * (i + 1) * p + c]
ret = 1000
for i in range(2 ** D):
	s = S[:]
	tot = 0
	top = 0
	m = 0
	am = 0
	for j in range(D):
		if i >> j & 1:
			s.remove(j)
			tot += iPC[j][0]
			top += iPC[j][1]
	if top < G and len(s) > 0:
		m = max(s)
		am = (G - top + ((m + 1) * 100 - 1)) // ((m + 1) * 100)
		if am < iPC[m][0]:
			tot += am
		else:
			tot = 1000
	ret = min(ret, tot)
print(ret)


def main():
	ans = 1000
	(d, g) = map(int, input().split())
	pc = [list(map(int, input().split())) for i in range(d)]
	pc.reverse()
	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
			continue
		for j in range(d):
			if not i & 1 << 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
						break
				break
	print(ans)

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


((d, g), *s) = [list(map(int, i.split())) for i in open(0)]

def c(i, t, l):
	if i == d:
		if t >= g:
			return sum(l)
		else:
			m = d - l[::-1].index(0)
			e = (t - g) // (m * 100)
			if -e < s[m - 1][0]:
				return sum(l) - e
			else:
				return 10 ** 3
	return min(c(i + 1, t, l + [0]), c(i + 1, t + s[i][0] * -~i * 100 + s[i][1], l + [s[i][0]]))
print(c(0, 0, []))


(d, g) = map(int, input().split())
ls = [list(map(int, input().split())) for i in range(d)]
P = list(map(lambda x: x[0], ls))
C = list(map(lambda x: x[1], 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)


(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())
dp = [[-10 ** 10] * (sum(P) + 111) for i in range(d + 1)]
for i in range(sum(P) + 1):
	dp[0][i] = 0
for i in range(1, d + 1):
	dp[i][0] = 0
for i in range(1, d + 1):
	for j in range(1, sum(P) + 1):
		dp[i][j] = max(max((dp[i - 1][j - k] + i * 100 * k for k in range(P[i - 1]))), dp[i - 1][j - P[i - 1]] + i * 100 * P[i - 1] + C[i - 1], dp[i][j - 1])
i = -1
while dp[d][i] < g:
	i = i + 1
print(i)


(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())
v = [list(map(int, input().split())) for i in range(d)]
ans = 1000
for i in range(1 << d):
	s = 0
	n = 0
	for j in range(d):
		if i >> j & 1 == 1:
			s += v[j][0] * (j + 1) * 100 + v[j][1]
			n += v[j][0]
	for j in range(d - 1, -1, -1):
		if i >> j & 1 == 0:
			r = ((g - s) // 100 + j) // (j + 1)
			if r > v[j][0]:
				n = 1000
			else:
				n += max(r, 0)
			break
	ans = min(ans, n)
print(ans)


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())

def main():

	def iterate_tokens():
		for line in sys.stdin:
			for word in line.split():
				yield word
	tokens = iterate_tokens()
	D = int(next(tokens))
	G = int(next(tokens))
	p = [int()] * D
	c = [int()] * D
	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():
	main()
__starting_point()


(d, g) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(d)]
ans = float('inf')
for i in range(2 ** d):
	a = []
	b = []
	s = 0
	sg = g
	for j in range(d):
		if i >> j & 1:
			a.append(j)
		else:
			b.append(j)
	if a:
		for k in a:
			sg -= 100 * (k + 1) * l[k][0] + l[k][1]
			s += l[k][0]
	if sg > 0:
		if b:
			for m in range(1, l[b[-1]][0]):
				sg -= 100 * (b[-1] + 1)
				s += 1
				if sg <= 0:
					ans = min(ans, s)
					break
	else:
		ans = min(ans, s)
print(ans)


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())
p = []
c = []
PC = [list(map(int, input().split())) for _ in range(D)]
PC = [0] + PC

def dfs(G, i):
	if i == 0:
		return 10 ** 12
	n = min((G - 1) // (100 * i) + 1, PC[i][0])
	tmp = n * 100 * i
	if n == PC[i][0]:
		tmp += PC[i][1]
	if tmp < G:
		n += dfs(G - tmp, i - 1)
	return min(n, dfs(G, i - 1))
print(dfs(G, D))


from itertools import product
(d, g) = (int(i) for i in input().split())
p = [[int(i) for i in input().split()] for i in range(d)]
(q, ans) = ([], 1001)
for i in range(d):
	q.append(p[i][0] * (i + 1) * 100 + p[i][1])
for i in product(range(2), repeat=d):
	(m, n, x) = (0, 0, [])
	for j in range(d):
		if i[j] == 1:
			(m, n) = (m + q[j], n + p[j][0])
		else:
			x.append(j)
	if m >= g:
		ans = min(ans, n)
	else:
		for k in x:
			num = (g - m + 99) // ((k + 1) * 100)
			if num < p[k][0]:
				ans = min(ans, n + num)
print(max(1, 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)


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)
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)


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = 0
for i in range(1 << d):
	p = 0
	cnt = 0
	for j in range(d):
		if i >> j & 1:
			p += 100 * (j + 1) * pc[j][0] + pc[j][1]
			cnt += pc[j][0]
	if g > p:
		for k in range(d)[::-1]:
			if i >> k & 1 == 0:
				if g - p <= 100 * (k + 1) * (pc[k][0] - 1):
					cnt += -(-(g - p) // (100 * (k + 1)))
					break
				else:
					cnt = 10 ** 5
					break
	if ans == 0 or ans > cnt:
		ans = cnt
print(ans)


(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))


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
		ret = min(ret, cnt)
	return ret

def __starting_point():
	main()
__starting_point()


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

def dfs(s, c):
	temp = 10 ** 3
	for i in range(D):
		if visited[i] == 0:
			visited[i] = 1
			if s >= p[i][0] * (i + 1) * 100 + p[i][1]:
				temp = min(temp, dfs(s - p[i][0] * (i + 1) * 100 - p[i][1], c + p[i][0]))
			else:
				temp = min(temp, -(-s // ((i + 1) * 100)) + c, p[i][0] + c)
			visited[i] = 0
	return temp
print(dfs(G, 0))


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, *L) = map(int, open(0).read().split())
inf = []
for m in zip(*[iter(L)] * 2):
	inf.append(m)
ans = float('inf')
for i in range(2 ** D):
	m = 0
	cnt = 0
	log = []
	for j in range(D):
		if i % 2 == 0:
			m += 100 * (j + 1) * inf[j][0] + inf[j][1]
			cnt += inf[j][0]
		else:
			log.append(j)
		i >>= 1
	while m < G:
		if log == []:
			break
		h = log.pop()
		s = 100 * (h + 1)
		x = (G - m) // s if (G - m) % s == 0 else (G - m) // s + 1
		c = min(inf[h][0] - 1, x)
		m += c * s
		cnt += c
	else:
		ans = min(ans, cnt)
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_)
sum_p = []
for i in range(d):
	sum_p.append((i + 1) * 100 * p[i] + c[i])

def ans(g, t):
	if t <= 0:
		return float('inf')
	n = min(int(g / (100 * t)), p[t - 1])
	s = 100 * t * n
	if n == p[t - 1]:
		s = sum_p[t - 1]
	if g > s:
		n += ans(g - s, t - 1)
	return min(n, ans(g, t - 1))
print(ans(g, d))


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

def ans(a, b):
	if a == 0:
		return 10 ** 9
	n = min(b // (a * 100), Q[a][0])
	score = a * 100 * n
	if n == Q[a][0]:
		score += Q[a][1]
	if score < b:
		n += ans(a - 1, b - score)
	n = min(n, ans(a - 1, b))
	return n
print(ans(D, G))


(d, g) = map(int, input().split())
pq = [list(map(int, input().split())) for i in range(d)]
ans = float('inf')
for i in range(2 ** d):
	hoge = 0
	score = 0
	cnt = 0
	for j in range(d):
		if i & 1 << j:
			score += (j + 1) * 100 * pq[j][0] + pq[j][1]
			cnt += pq[j][0]
		else:
			hoge = j
	tmp = max(0, -(-(g - score) // ((hoge + 1) * 100)))
	if tmp <= pq[hoge][0]:
		ans = min(ans, cnt + tmp)
print(ans)


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

def f(i, s):
	if i == 0:
		return 10 ** 9
	cnt = min(s // (100 * i), p[i][0])
	score = 100 * i * cnt
	if cnt == p[i][0]:
		score += p[i][1]
	if s > score:
		cnt += f(i - 1, s - score)
	return min(cnt, f(i - 1, s))

def main():
	print(f(d, g))
main()


import math
(n, g) = map(int, input().split())
lis = []
sum = []
for i in range(n):
	(a, b) = map(int, input().split())
	lis.append([a, b])
	sum.append((i + 1) * 100 * a + b)

def ans(x, y):
	if y <= 0:
		return 10 ** 12
	nu = min(math.ceil(x / (100 * y)), lis[y - 1][0])
	num = 100 * y * nu
	if nu == lis[y - 1][0]:
		num += lis[y - 1][1]
	if num >= x:
		cou = nu
	else:
		cou = nu + ans(x - num, y - 1)
	return min(cou, ans(x, y - 1))
print(ans(g, n))


(D, G) = map(int, input().split())
S = [[0] for i in range(D + 1)]
B = [[0] for i in range(D + 1)]
sumP = 0
for i in range(D):
	(p, c) = map(int, input().split())
	S[i + 1] += [0] * (len(S[i]) + p - 1)
	B[i + 1] += [100 * (i + 1) * (x + 1) for x in range(p)]
	B[i + 1][-1] += c
for i in range(1, D + 1):
	for j in range(1, len(S[i])):
		for k in range(max(j - len(S[i - 1]) + 1, 0), min(len(B[i]), j + 1)):
			S[i][j] = max(B[i][k] + S[i - 1][j - k], S[i][j])
for (i, s) in enumerate(S[D]):
	if s >= G:
		print(i)
		break


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]
ans = 10 ** 18
for i in range(2 ** d):
	cnt = 0
	res = []
	x = 0
	for j in range(d):
		if i >> j & 1:
			cnt += pc[j][1] + pc[j][0] * (j + 1) * 100
			x += pc[j][0]
		else:
			res.append((100 * (j + 1), pc[j][0]))
	res.sort(reverse=True)
	if cnt >= g:
		ans = min(ans, x)
	elif len(res) > 0:
		y = res[0]
		z = 0
		while z < y[1] and cnt < g:
			cnt += y[0]
			z += 1
		if cnt >= g:
			ans = min(ans, x + z)
print(ans)


(d, g) = map(int, input().split())
l = [list(map(int, input().split())) for _ in range(d)]
ans = 1000
for b in range(1 << d):
	s = 0
	cnt = 0
	for i in range(d):
		if b & 1 << i:
			s += l[i][0] * (i + 1) * 100 + l[i][1]
			cnt += l[i][0]
	for i in range(d - 1, -1, -1):
		if not b & 1 << i:
			for j in range(1, l[i][0]):
				if s < g:
					s += (i + 1) * 100
					cnt += 1
	if s >= g:
		ans = min(ans, cnt)
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)


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)


(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))


(D, G) = [int(i) for i in input().split()]
(P, C) = ([0] * (D + 1), [0] * (D + 1))
for i in range(D):
	(P[i + 1], C[i + 1]) = [int(i) for i in input().split()]

def solve(d, g):
	if d <= 0:
		return 100000.0
	n = min(g // (d * 100), P[d])
	score = d * 100 * n
	if n == P[d]:
		score += C[d]
	if score < g:
		n += solve(d - 1, g - score)
	return min(n, solve(d - 1, g))
print(solve(D, G))


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):
		(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()


(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])
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)
	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())
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())
(p, c) = ([0] * d, [0] * d)
for i in range(d):
	(p[i], c[i]) = map(int, input().split())
ans = float('inf')
for i in range(2 ** d):
	s = 0
	cnt = 0
	rest_max = -1
	for j in range(d):
		if i >> j & 1:
			s += 100 * (j + 1) * p[j] + c[j]
			cnt += p[j]
		else:
			rest_max = j
	if s < g:
		s1 = 100 * (rest_max + 1)
		need = (g - s + s1 - 1) // s1
		if need >= p[rest_max]:
			continue
		cnt += need
	ans = min(ans, cnt)
print(ans)


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

def dfs(G, i):
	if i == 0:
		return 1000000000.0
	n = min(G // (i * 100), pc[i][0])
	s = n * i * 100
	if n == pc[i][0]:
		s += pc[i][1]
	if s < G:
		n += dfs(G - s, i - 1)
	return min(n, dfs(G, i - 1))
print(dfs(g, d))


(d, g) = map(int, input().split())
g //= 100
l = []
for i in range(d):
	(p, c) = map(int, input().split())
	c //= 100
	l.append((p, c))
mn = 10000
for i in range(2 ** d):
	pcnt = 0
	qcnt = 0
	nm = None
	for j in range(d):
		if i & 2 ** j:
			pcnt += (j + 1) * l[j][0] + l[j][1]
			qcnt += l[j][0]
		else:
			nm = j
	if pcnt < g:
		need = (g - pcnt - 1) // (nm + 1) + 1
		if need < l[nm][0]:
			qcnt += need
		else:
			qcnt += 10000
	mn = min(mn, qcnt)
print(mn)


(d, g) = map(int, input().split())
li = []
for i in range(1, d + 1):
	(p, c) = map(int, input().split())
	li.append([p, i * 100 * p + c])
ans = 10 ** 5
for i in range(2 ** d):
	s = t = u = 0
	for j in range(d):
		if 1 & i >> j:
			s += li[j][1]
			u += li[j][0]
		else:
			t = max(t, j + 1)
	if g <= s:
		ans = min(ans, u)
	elif g <= s + t * 100 * (li[t - 1][0] - 1):
		u -= (g - s) // -(100 * t)
		ans = min(ans, u)
print(ans)


from math import ceil
(d, g) = map(int, input().split())
point = [list(map(int, input().split())) for _ in range(d)]
ans = 10 ** 18
for i in range(2 ** d):
	l = []
	cnt = 0
	s = 0
	for j in range(d):
		if i >> j & 1:
			cnt += point[j][0]
			s += point[j][0] * 100 * (j + 1) + point[j][1]
		else:
			l.append(j)
	if s >= g:
		ans = min(ans, cnt)
		continue
	for j in l:
		if g - s > 100 * (j + 1) * (point[j][0] - 1):
			continue
		else:
			ans = min(ans, cnt + ceil((g - s) / (100 * (j + 1))))
print(ans)


(d, g) = map(int, input().split())
p = [list(map(int, input().split())) for i in range(d)]
x = []
for i in range(2 ** d):
	t = 0
	u = 0
	v = []
	for k in range(d):
		v.append(k)
	for j in range(d):
		if i >> j & 1:
			t += p[j][0] * 100 * (j + 1) + p[j][1]
			u += p[j][0]
			v[j] = 0
	if t >= g:
		x.append(u)
	else:
		for l in range(p[max(v)][0]):
			if t + (max(v) + 1) * 100 * l < g <= t + (max(v) + 1) * 100 * (l + 1):
				x.append(u + l + 1)
print(min(x))


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))


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) = map(int, input().split())
points = [0 for _ in range(D)]
for i in range(D):
	points[i] = list(map(int, input().split()))

def solve(d, g):
	if d <= 0:
		return 10 ** 5
	n = min(g // (100 * d), points[d - 1][0])
	s = 100 * d * n
	if n == points[d - 1][0]:
		s = d * points[d - 1][0] * 100 + points[d - 1][1]
	if g > s:
		n += solve(d - 1, g - s)
	return min(n, solve(d - 1, g))
print(solve(D, G))


(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())
p = [list(map(int, input().split())) for _ in range(d)]
ans = 1000
for i in range(1 << d):
	score = 0
	num = 0
	remain_max = -1
	for j in range(d):
		if i >> j & 1:
			score += p[j][0] * 100 * (j + 1) + p[j][1]
			num += p[j][0]
		else:
			remain_max = j
	if score < g:
		remain = 100 * (remain_max + 1)
		need = -(-(g - score) // remain)
		if need >= p[remain_max][0]:
			continue
		num += need
	ans = min(ans, num)
print(ans)


(D, G) = map(int, input().split())
PC = [tuple(map(int, input().split())) for _ in range(D)]
minNum = 10 ** 3
for i in range(2 ** D):
	point = 0
	num = 0
	leftOvers = []
	for j in range(D):
		if i >> j & 1:
			num += PC[j][0]
			point += PC[j][1] + 100 * (j + 1) * PC[j][0]
		else:
			leftOvers.extend([100 * (j + 1)] * PC[j][0])
	while point < G:
		if not leftOvers:
			break
		point += leftOvers.pop()
		num += 1
	minNum = min(num, minNum)
print(minNum)


(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 = 10000000000.0
for i in range(2 ** D):
	sum = 0
	q = 0
	for j in range(D):
		if i >> j & 1:
			sum += (j + 1) * 100 * p[j] + c[j]
			q += p[j]
		else:
			rest_max = j
	if sum < G:
		r1 = 100 * (rest_max + 1)
		need = -(-(G - sum) // r1)
		if need > p[rest_max] - 1:
			continue
		q += need
		sum += need * r1
	if sum >= G:
		ans = min(ans, q)
print(ans)


(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]:
			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]:
				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) = map(int, input().split())
PC = [list(map(int, input().split())) for _ in range(D)]
(p, c) = zip(*PC)
min_count = 10 ** 18
for i in range(1 << D):
	h = -1
	point = 0
	count = 0
	for j in range(D):
		if (i >> j) % 2:
			point += 100 * (j + 1) * p[j] + c[j]
			count += p[j]
		else:
			h = j
	if h > -1 and G > point:
		x = -(-(G - point) // (100 * (h + 1)))
		if x > p[h]:
			continue
		count += x
	min_count = min(min_count, count)
print(min_count)


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

def solve(G, i):
	if i < 0:
		return 10 ** 9
	n = min(G // (100 * (i + 1)), Q[i][0])
	p = 100 * (i + 1) * n
	if n == Q[i][0]:
		p += Q[i][1]
	if p < G:
		ans = n + solve(G - p, i - 1)
	else:
		ans = n
	return min(ans, solve(G, i - 1))
print(solve(G, D - 1))


(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)


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

def dfs(G, i):
	if i <= 0:
		return float('inf')
	n = min(ceil(G / (100 * i)), list[i - 1][0])
	s = 100 * i * n
	if n == list[i - 1][0]:
		s += list[i - 1][1]
	if G > s:
		n += dfs(G - s, i - 1)
	return min(n, dfs(G, i - 1))
print(dfs(G, D))


(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)


from itertools import product
from math import ceil
(n, k) = map(int, input().split())
A = []
for i in range(1, n + 1):
	(a, b) = map(int, input().split())
	A += [(a, i * 100, a * i * 100 + b)]
ans = 1000000000.0
for p in product([0, 1], repeat=n):
	s = 0
	c = 0
	m = 0
	for (i, j) in enumerate(p):
		if j == 1:
			c += A[i][0]
			s += A[i][2]
		else:
			m = max(m, i)
	if s >= k:
		ans = min(ans, c)
	elif (k - s) / A[m][1] < A[m][0]:
		ans = min(ans, c + ceil((k - s) / A[m][1]))
print(ans)


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

def dfs(d, g):
	if d == 0:
		return 1000000000.0
	l = min(g // (d * 100), s[d - 1][0])
	k = 100 * d * l
	if l == s[d - 1][0]:
		k += s[d - 1][1]
	if k < g:
		l += dfs(d - 1, g - k)
	return min(l, dfs(d - 1, g))
print(dfs(d, g))


(d, g) = map(int, input().split(' '))
li = []
for x in range(d):
	li.append(list(map(int, input().split(' '))))
sum = []
for i in range(2 ** d):
	s = 0
	a = 0
	z = []
	for j in range(d):
		if i >> j & 1:
			s += li[j][0] * 100 * (j + 1) + li[j][1]
			a += li[j][0]
		else:
			z.append(j)
	if s >= g:
		sum.append(a)
	else:
		k = max(z)
		h = g - s
		for l in range(li[k][0]):
			if l * (k + 1) * 100 >= h:
				sum.append(a + l)
print(min(sum))


I = lambda : map(int, input().split())
divup = lambda x, y: (x + y - 1) // y
(D, G) = I()
P = {}
C = {}
Score = {}
for i in range(D):
	(P[i], C[i]) = I()
	Score[i] = -~i * 100 * P[i] + C[i]
r = 1000000000.0 + 7
for k in range(1 << D):
	str_branch = str(bin(k))[2:].rjust(D, '0')
	probs = 0
	score = 0
	for (i, b) in enumerate(str_branch):
		if b == '1':
			probs += P[i]
			score += Score[i]
	if score >= G:
		r = min(r, probs)
		continue
	for i in range(D)[::-1]:
		pi = -~i * 100
		if str_branch[i] == '0' and G - score < pi * P[i]:
			r = min(r, probs + divup(G - score, pi))
			break
print(r)


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(d)]
ans = 1000
for i in range(1 << d):
	score = 0
	num = 0
	rest = 0
	for j in range(d):
		if i >> j & 1 == 1:
			score += pc[j][0] * 100 * (j + 1) + pc[j][1]
			num += pc[j][0]
		else:
			rest = j
	if score < g:
		need = (g - score - 1) // (100 * (rest + 1)) + 1
		if need > pc[rest][0] - 1:
			continue
		else:
			num += need
	ans = min(ans, num)
print(ans)


import sys

def f(g, d, P, C):
	if d <= 0:
		return float('inf')
	n = min(g // (100 * d), P[d - 1])
	s = 100 * d * n
	if n == P[d - 1]:
		s += C[d - 1]
	if g > s:
		n += f(g - s, d - 1, P, C)
	return min(n, f(g, d - 1, P, C))

def main():
	input = sys.stdin.readline
	(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 = f(G, D, P, C)
	print(ans)
main()


(d, g) = map(int, input().split())
g //= 100
l = []
ans = 1000
for i in range(1, d + 1):
	(p, c) = map(int, input().split())
	c //= 100
	l += [[p, c, i * p, i * p + c]]
for i in range(2 ** d):
	score = 0
	a = 0
	b = 1
	c = 0
	if not i:
		b = d
	while i:
		if i % 2 > 0:
			score += l[a][3]
			c += l[a][0]
		else:
			b = a + 1
		a += 1
		i //= 2
	if score >= g:
		ans = min(ans, c)
	elif score + l[b - 1][2] >= g:
		ans = min(ans, c + (g - score) // b + ((g - score) % b > 0))
print(ans)


(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')
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]
	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)


import math
(a, b) = map(int, input().split())
List = [list(map(int, input().split())) for i in range(a)]
ans = 10000000000000
for i in range(2 ** a):
	s = 0
	c = 0
	t = True
	x = 0
	y = 0
	for j in range(a):
		if i >> j & 1:
			s += (a - j) * 100 * List[a - 1 - j][0] + List[a - 1 - j][1]
			c += List[a - 1 - j][0]
		elif t:
			x = (a - j) * 100
			y = List[a - 1 - j][0]
			t = False
	if b <= s:
		if ans > c:
			ans = c
	elif math.ceil((b - s) / x) <= y:
		c += math.ceil((b - s) / x)
		if ans > c:
			ans = c
print(ans)


(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 = [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')
	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)


import math
(d, g) = map(int, input().split())
l = [list(map(int, input().split())) for i in range(d)]
ans = float('inf')
for bit in range(1 << d):
	sum = 0
	count = 0
	f = set(range(1, d + 1))
	for i in range(d):
		if bit & 1 << i:
			sum += (i + 1) * l[i][0] * 100 + l[i][1]
			count += l[i][0]
			f.discard(i + 1)
	if sum < g:
		x = max(f)
		n = min(l[x - 1][0], math.ceil((g - sum) / (x * 100)))
		sum += n * 100 * x
		count += n
	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)]
ans = 10 ** 18
import math
for i in range(2 ** D):
	_i = i
	j = 0
	s = []
	_ans = 0
	g = 0
	while i > 0:
		if i % 2 == 1:
			_ans += PC[j][0]
			g += PC[j][0] * 100 * (j + 1) + PC[j][1]
			s.append(j)
		j += 1
		i = i // 2
	if g >= G:
		ans = min(ans, _ans)
	else:
		j = D - 1
		while j in s:
			j -= 1
		if j > -1 and G - g <= (PC[j][0] - 1) * 100 * (j + 1):
			_ans += math.ceil((G - g) / 100 / (j + 1))
			ans = min(ans, _ans)
print(ans)


(d, g) = map(int, input().split())
pc = []
m = 0
for i in range(d):
	pc.append(list(map(int, input().split())))
	m += pc[-1][0]
for i in range(2 ** d - 1):
	cur = bin(i)[2:]
	cur = '0' * (d - len(cur)) + cur
	csum = 0
	cc = 0
	for j in range(d):
		if cur[j] == '0':
			ci = j
		else:
			csum += (j + 1) * 100 * pc[j][0] + pc[j][1]
			cc += pc[j][0]
	if csum >= g:
		m = min(m, cc)
	elif csum + (ci + 1) * 100 * pc[ci][0] >= g:
		m = min(m, cc + (g - csum - 1) // (100 * (ci + 1)) + 1)
print(m)


(d, g) = map(int, input().split())
g = g // 100
p = [0] * (d + 1)
c = [0] * (d + 1)
for i in range(1, d + 1):
	(p[i], c[i]) = map(int, input().split())
	c[i] = c[i] // 100

def dfs(h, s):
	if h == 0:
		return 10 ** 9
	tmp = min(p[h], s // h)
	score = tmp * h
	if tmp == p[h]:
		score += c[h]
	if score < s:
		tmp += dfs(h - 1, s - score)
	return min(tmp, dfs(h - 1, s))
print(dfs(d, g))


(D, G) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(D)]
r = 1000
from itertools import product
for X in product(range(2), repeat=D):
	(g, a) = (0, 0)
	for (i, x) in enumerate(X):
		if x:
			g += pc[i][1] + pc[i][0] * (i + 1) * 100
			a += pc[i][0]
	for i in range(D - 1, -1, -1):
		if X[i] == 1:
			continue
		if g >= G:
			break
		n = min(pc[i][0] - 1, -((g - G) // ((i + 1) * 100)))
		a += n
		g += n * (i + 1) * 100
	if g >= G:
		r = min(r, a)
print(r)


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())
ps = [list(map(int, input().split())) for i in range(d)]
ans = 9999999999
for i in range(2 ** d):
	s = bin(i)[2:].zfill(d)
	c = p = 0
	a = []
	for j in range(d):
		c += ps[j][0] * int(s[j])
		p += (ps[j][0] * (j + 1) * 100 + ps[j][1]) * int(s[j])
		if s[j] == '0':
			a.append(j)
	if p >= g:
		ans = min(ans, c)
	else:
		a.sort(reverse=1)
		while p < g:
			k = min((g - p + (a[0] + 1) * 100 - 1) // ((a[0] + 1) * 100), ps[a[0]][0])
			p += k * (a[0] + 1) * 100
			if k == ps[a[0]][0]:
				p += ps[a[0]][1]
			c += k
			del a[0]
		ans = min(ans, c)
print(ans)


(d, g) = map(int, input().split())
a = []
for i in range(d):
	a.append(list(map(int, input().split())))
ans = float('inf')
for i in range(2 ** d):
	i = list(map(int, list(bin(i)[2:].zfill(d))))
	(x, y, z) = (0, 0, 0)
	for j in range(d):
		if i[j] == 1:
			x += a[j][0]
			y += (j + 1) * 100 * a[j][0] + a[j][1]
		else:
			z = j
	if g - y > 0:
		b = (g - y + z * 100) // ((z + 1) * 100)
		if b < a[z][0]:
			ans = min(ans, x + b)
	else:
		ans = min(ans, x)
print(ans)


from itertools import product
import math
(D, G) = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(D)]
cmin = 10 ** 4
for x in product((0, 1), repeat=D):
	scr = 0
	cnt = 0
	j = -1
	for i in range(D):
		if x[i] == 1:
			scr += 100 * (i + 1) * A[i][0] + A[i][1]
			cnt += A[i][0]
		else:
			j = i
	if scr >= G:
		cmin = min(cmin, cnt)
	else:
		k = math.ceil((G - scr) / (100 * (j + 1)))
		if k < A[j][0]:
			cmin = min(cmin, cnt + k)
print(cmin)


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()


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)
__starting_point()


(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):
	s = 0
	c = 0
	for k in range(D):
		if 1 & i >> k:
			s += (k + 1) * 100 * pc[k][0] + pc[k][1]
			c += pc[k][0]
	if s >= G:
		ans = min(ans, c)
	if s < G:
		for k in reversed(range(D)):
			if not 1 & i >> k:
				ac = -(-(G - s) // ((k + 1) * 100))
				if pc[k][0] > ac:
					ans = min(ans, c + ac)
					break
print(ans)


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


(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 = []
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)


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))


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

def dfs(i, sum, count, residue):
	if i == d:
		if sum < g:
			use = max(residue)
			n = min(pc[use - 1][0], -(-(g - sum) // (use * 100)))
			count += n
			sum += n * use * 100
		if sum >= g:
			ans.append(count)
	else:
		dfs(i + 1, sum, count, residue)
		dfs(i + 1, sum + pc[i][0] * (i + 1) * 100 + pc[i][1], count + pc[i][0], residue - {i + 1})
dfs(0, 0, 0, set(range(1, d + 1)))
print(min(ans))


((d, g), *l) = [list(map(int, i.split())) for i in open(0)]

def f(i, g):
	if i == 0:
		return 1000000000.0
	(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)))


(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())
answer = 0
Q = []
for i in range(d):
	(p, c) = map(int, input().split())
	answer += p
	Q.append((i + 1, p, c))
dp = [-10 ** 9] * (answer + 1)
dp[0] = 0
for (i, p, c) in Q:
	for j in range(answer, -1, -1):
		for k in range(1, p + 1):
			cc = i * 100 * k
			if k == p:
				cc += c
			if j - k >= 0:
				dp[j] = max(dp[j], dp[j - k] + cc)
for i in range(answer + 1):
	if dp[i] >= g:
		print(i)
		exit()


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)
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())
l = [list(map(int, input().split())) for _ in range(d)]
for i in range(d):
	s = l[i][0] * 100 * -~i
	l[i].append(s + l[i][1])
	l[i].append(s)
a = 10 ** 18
for i in range(1 << d):
	s = t = k = 0
	for j in range(d):
		if i >> j & 1:
			s += l[j][2]
			t += l[j][0]
		else:
			k = j
	if s + l[k][3] < g:
		continue
	if s < g:
		t += -(-(g - s) // (100 * -~k))
	a = min(a, t)
print(a)


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

def solve(g, i):
	if i <= 0:
		return 1000000000.0
	n = min(int(g / (100 * i)), p[i - 1])
	s = 100 * i * n
	if n == p[i - 1]:
		s += c[i - 1]
	if g > s:
		n += solve(g - s, i - 1)
	return min(n, solve(g, i - 1))
print(solve(g, d))


(d, g) = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]
ans = 10000
for i in range(2 ** d):
	score = 0
	b = 0
	cnt = 0
	for j in range(d):
		if i >> j & 1:
			score += (j + 1) * pc[j][0] * 100 + 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, G) = map(int, input().split())
MAX = D * 100 + 1
s = 1
g = D * 100 + 1
z = [[0 for i in range(MAX)] for j in range(D + 1)]
for i in range(1, D + 1):
	(p, c) = map(int, input().split())
	for j in range(s):
		for k in range(p + 1):
			z[i][j + k] = max(z[i][j + k], z[i - 1][j] + 100 * k * i + (c if k == p else 0))
			if z[i][j + k] >= G and g > j + k:
				g = j + k
	s += p
print(g)


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))