Caisa is going to have a party and he needs to buy the ingredients for a big chocolate cake. For that he is going to the biggest supermarket in town.

Unfortunately, he has just s dollars for sugar. But that's not a reason to be sad, because there are n types of sugar in the supermarket, maybe he able to buy one. But that's not all. The supermarket has very unusual exchange politics: instead of cents the sellers give sweets to a buyer as a change. Of course, the number of given sweets always doesn't exceed 99, because each seller maximizes the number of dollars in the change (100 cents can be replaced with a dollar).

Caisa wants to buy only one type of sugar, also he wants to maximize the number of sweets in the change. What is the maximum number of sweets he can get? Note, that Caisa doesn't want to minimize the cost of the sugar, he only wants to get maximum number of sweets as change. 


-----Input-----

The first line contains two space-separated integers n, s (1 ≤ n, s ≤ 100).

The i-th of the next n lines contains two integers x_{i}, y_{i} (1 ≤ x_{i} ≤ 100; 0 ≤ y_{i} < 100), where x_{i} represents the number of dollars and y_{i} the number of cents needed in order to buy the i-th type of sugar.


-----Output-----

Print a single integer representing the maximum number of sweets he can buy, or -1 if he can't buy any type of sugar.


-----Examples-----
Input
5 10
3 90
12 0
9 70
5 50
7 0

Output
50

Input
5 5
10 10
20 20
30 30
40 40
50 50

Output
-1



-----Note-----

In the first test sample Caisa can buy the fourth type of sugar, in such a case he will take 50 sweets as a change.

Difficulty: EASY
Tags: Implementation

Complete search
Skill types: Complete search

Starter code:

Solutions:
(n, s) = [int(x) for x in input().split(' ')]
s *= 100
c = -1
for i in range(n):
	(x, y) = [int(x) for x in input().split(' ')]
	if x * 100 + y <= s:
		c = max((100 - y) % 100, c)
print(c)


(n, s) = map(int, input().split())
ans = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if x * 100 + y <= s * 100:
		if (100 - y) % 100 > ans:
			ans = (100 - y) % 100
print(ans)


(n, s) = map(int, input().split())
mn = 101
zero = False
for i in range(n):
	(d, c) = map(int, input().split())
	if d == s and c == 0:
		zero = True
		continue
	if d < s and c < mn:
		if c == 0:
			zero = True
		else:
			mn = c
if mn > 100 and zero:
	print('0')
elif mn > 100:
	print('-1')
else:
	print(100 - mn)


(n, s) = map(int, input().split())
mn = 1000
ans = 0
for i in range(n):
	(x, y) = map(int, input().split())
	cost = x + y / 100
	if cost <= s:
		mn = min(mn, x)
		if y == 0:
			continue
		ans = max(ans, min(99, 100 - y))
if mn == 1000:
	ans = -1
print(ans)


(n, s) = map(int, input().strip().split())
dis = dict()
ans = 100
ok = 0
for i in range(n):
	(d, c) = map(int, input().strip().split())
	if d < s and c > 0:
		ans = min(ans, c)
	if d < s or (d == s and c == 0):
		ok = 1
if ok:
	print(100 - ans)
else:
	print(-1)


(n, s) = map(int, input().split())
m = -1
for i in range(n):
	(l, x) = map(int, input().split())
	if l < s:
		if x > 0:
			m = max(m, 100 - x)
		else:
			m = max(m, 0)
	elif l == s:
		if x == 0:
			m = max(m, 0)
print(m)


(n, s) = [int(i) for i in input().split()]
ans = -1
for _ in range(n):
	(x, y) = [int(i) for i in input().split()]
	z = 100 * x + y
	if 100 * s >= z:
		ans = max(ans, (100 - y) % 100)
print(ans)


import sys
import string
from collections import Counter, defaultdict
from math import fsum, sqrt, gcd, ceil, factorial
from operator import add
inf = float('inf')
flush = lambda : sys.stdout.flush
comb = lambda x, y: factorial(x) // factorial(y) // factorial(x - y)
ip = lambda : input()
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())
(n, k) = r()
ans = -1
for _ in range(n):
	(a, b) = r()
	if not b and a == k:
		ans = max(ans, b)
	if a < k:
		ans = max(ans, (100 - b) % 100)
print(ans)


(n, s) = map(int, input().split())
a = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if y == 0:
		y = 100
	if s > x:
		if a < 100 - y:
			a = 100 - y
	elif s == x and y == 100 and (a == -1):
		a = 0
print(a)


(n, s) = map(int, input().split(' '))
ans = -1
for _ in range(n):
	(a, b) = map(int, input().split(' '))
	if a < s:
		if b != 0:
			ans = max(ans, 100 - b)
	if a <= s and b == 0:
		ans = max(ans, 0)
print(ans)


(n, s) = map(int, input().split())
ans = -1
for x in range(n):
	(d, c) = map(int, input().split())
	if d < s or (d == s and c == 0):
		ans = max(ans, 0 if c == 0 else 100 - c)
print(ans)


(n, s) = [int(i) for i in input().split()]
x = [0] * n
y = [0] * n
smin = 100
for i in range(n):
	(x[i], y[i]) = [int(x) for x in input().split()]
	if x[i] < s and y[i] < smin and (y[i] != 0):
		smin = y[i]
if smin == 100:
	smin = -1
	for i in range(n):
		if x[i] <= s and y[i] == 0:
			smin = 0
	print(smin)
else:
	print(100 - smin)


m = list(input().split())
n = int(m[0])
s = int(m[1]) * 100
m = list()
for i in range(n):
	m.append(list((int(x) for x in input().split())))
t = 100000
mi = None
t0 = 0
for i in range(n):
	if m[i][0] * 100 + m[i][1] <= s and m[i][1] < t:
		if m[i][1]:
			t = m[i][1]
		else:
			t0 = 1
if t == 100000:
	if t0:
		print('0')
	else:
		print('-1')
else:
	print(100 - t)


(t, m) = input('').split()
c = 0
flag = 0
t = int(t)
m = int(m)
for i in range(0, t):
	(p, q) = input('').split()
	p = int(p)
	q = int(q)
	if p < m or (p == m and q == 0):
		flag = 1
		if q > 0:
			if 100 - q > c:
				c = 100 - q
if flag == 0:
	print(-1)
else:
	print(c)


(n, s) = map(int, input().split(' '))
a = []
aa = []
aaa = []
for x in range(n):
	(q, qq) = map(int, input().split(' '))
	if qq > 0 and s > q:
		a.append(qq)
	aaa.append(qq)
	aa.append(float(q + float(qq / 100)))
	pass
if s < min(aa):
	print(-1)
else:
	if len(a) == 0:
		print(0)
		pass
	else:
		print(100 - min(a))
	pass


(n, s) = map(int, input().split())
m = -1
for i in range(n):
	(x, y) = map(int, input().split())
	csum = (s - x) * 100 - y
	if csum <= s * 100 and csum >= 0 and (csum % 100 > m):
		m = csum % 100
print(m)


(n, s) = map(int, input().split())
cnt = 0
find = False
for i in range(n):
	(x1, y1) = map(int, input().split())
	if x1 < s or (x1 == s and y1 == 0):
		find = True
		if 100 - y1 > cnt and y1 != 0:
			cnt = 100 - y1
if find:
	print(cnt)
else:
	print('-1')


(n, s) = map(int, input().split())
ans = 0
flag = 0
for i in range(n):
	x = list(map(int, input().split()))
	if x[0] > s or (x[0] == s and x[1] > 0) or (x[0] == s and x[1] == 0):
		if x[0] == s and x[1] == 0:
			flag = 1
		continue
	elif x[0] < s and x[1] != 0 and (100 - x[1] > ans):
		flag = 1
		ans = 100 - x[1]
	elif x[0] < s and x[1] == 0:
		flag = 1
if flag == 1:
	print(ans)
else:
	print(-1)


firstLine = [int(x) for x in input().split()]
reps = firstLine[0]
cents = 100 * firstLine[1]
best = -1
for i in range(0, reps):
	temp = [int(x) for x in input().split()]
	tempC = temp[0] * 100 + temp[1]
	if tempC <= cents:
		gain = 100 - temp[1]
		if gain == 100:
			gain = 0
		if gain > best:
			best = gain
print(best)


(n, s) = map(int, input().split())
ans = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if s == x:
		if y > 0:
			continue
		else:
			ans = max(ans, 0)
	elif s > x:
		tmp = 100 - y
		if tmp == 100:
			tmp = 0
		ans = max(ans, tmp)
print(ans)


(n, s) = map(int, input().split())
mx = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if x < s or (x == s and y == 0):
		mx = max(mx, 100 - (y or 100))
print(mx)


(n, s) = map(int, input().split())
m = -1
for _ in range(n):
	(d, c) = map(int, input().split())
	if s > d or (s == d and c == 0):
		m = max(m, (100 - c) % 100)
print(int(m))


(n, s) = map(int, input().split())
s *= 100
ans = -1
for _ in range(n):
	(x, y) = map(int, input().split())
	x = x * 100 + y
	if s < x:
		continue
	ans = max(ans, (100 - y) % 100)
print(ans)


(n, s) = map(int, input().split())
a = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if s * 100 >= x * 100 + y:
		a = max(a, (s * 100 - x * 100 - y) % 100)
print(a)


(n, s) = map(int, input().split())
c = -1
for i in range(n):
	(xi, yi) = list(map(int, input().split()))
	if yi == 0 and xi <= s:
		c = max(0, c)
	elif xi < s:
		c = max(100 - yi, c)
print(c)


ID = input().split()
n = int(ID[0])
s = int(ID[1]) * 100
ans = -1
for i in range(n):
	ID = input().split()
	x = 100 * int(ID[0]) + int(ID[1])
	if x <= s and (s - x) % 100 > ans:
		ans = (s - x) % 100
print(ans)


canBuy = False
swt = 0
(n, s) = list(map(int, input().split()))
for q in range(n):
	(x, y) = list(map(int, input().split()))
	if s > x or (s >= x and y == 0):
		canBuy = True
		if y == 0:
			continue
		elif 100 - y >= swt:
			swt = 100 - y
if canBuy:
	print(swt)
else:
	print(-1)


(n, s) = map(int, input().split())
maxx = -1
for i in range(n):
	(a, b) = map(int, input().split())
	if 100 * a + b <= 100 * s and (100 - b) % 100 > maxx:
		maxx = (100 - b) % 100
print(maxx)


inp = list(map(int, input().split()))
n = inp[0]
t = inp[1]
l = []
s = []
for i in range(n):
	inp = list(map(int, input().split()))
	if inp[0] <= t:
		if inp[1] != 0 and inp[0] < t:
			l.append(inp[1])
		elif inp[0] <= t and inp[1] == 0:
			s.append(inp[1])
if len(l) == 0 and len(s) == 0:
	print(-1)
elif len(l) == 0:
	print(0)
else:
	print(100 - min(l))


import sys
import math
import itertools
import collections

def getdict(n):
	d = {}
	if type(n) is list or type(n) is str:
		for i in n:
			if i in d:
				d[i] += 1
			else:
				d[i] = 1
	else:
		for i in range(n):
			t = ii()
			if t in d:
				d[t] += 1
			else:
				d[t] = 1
	return d

def divs(n, start=1):
	r = []
	for i in range(start, int(math.sqrt(n) + 1)):
		if n % i == 0:
			if n / i == i:
				r.append(i)
			else:
				r.extend([i, n // i])
	return r

def cdiv(n, k):
	return n // k + (n % k != 0)

def ii():
	return int(input())

def mi():
	return map(int, input().split())

def li():
	return list(map(int, input().split()))

def lcm(a, b):
	return abs(a * b) // math.gcd(a, b)

def wr(arr):
	return ''.join(map(str, arr))

def revn(n):
	return int(str(n)[::-1])

def prime(n):
	if n == 2:
		return True
	if n % 2 == 0 or n <= 1:
		return False
	sqr = int(math.sqrt(n)) + 1
	for d in range(3, sqr, 2):
		if n % d == 0:
			return False
	return True

def convn(number, base=3):
	newnumber = ''
	while number > 0:
		newnumber = str(number % base) + newnumber
		number //= base
	return newnumber
(n, s) = mi()
ans = -1
for i in range(n):
	(x, y) = mi()
	if x + y / 100 <= s:
		ans = max(ans, (100 - y) % 100)
print(ans)


(values, moneyAvailable) = map(int, input().split())
max = 0
flag = 0
for i in range(0, values):
	(x, y) = map(int, input().split())
	if x < moneyAvailable:
		flag = 1
		if y != 0:
			z = 100 - y
			if z > max:
				max = z
	elif x == moneyAvailable:
		if y == 0:
			flag = 1
if flag == 1:
	print(max)
else:
	print('-1')


(n, s) = map(int, input().split())
k = -1
for i in range(n):
	(a, b) = map(int, input().split())
	if a < s and 100 - b > k:
		if b != 0:
			k = 100 - b
		elif b != 0 and k != 100:
			k = 0
		elif a < s and 0 > k:
			k = 0
	elif a == s and b == 0 and (k == -1):
		k = 0
if n == 1 and a <= s:
	if b == 0:
		k = 0
	elif a != s:
		k = 100 - b
print(k)


def main():
	(n, s) = read()
	mx = -1
	for i in range(n):
		(x, y) = read()
		if y == 0 and x <= s:
			mx = max(0, mx)
		elif x < s:
			mx = max(100 - y, mx)
	print(mx)

def read(mode=2):
	inputs = input().strip()
	if mode == 0:
		return inputs
	if mode == 1:
		return inputs.split()
	if mode == 2:
		return list(map(int, inputs.split()))

def write(s='\n'):
	if s is None:
		s = ''
	if isinstance(s, list):
		s = ' '.join(map(str, s))
	s = str(s)
	print(s, end='')
write(main())


my_str = input().split()
(n, s) = (int(my_str[0]), int(my_str[1]))
cost = []
for i in range(n):
	my_str = input().split()
	cost.append([int(my_str[j]) for j in range(2)])
res = -1
for i in range(n):
	a = s * 100 - cost[i][0] * 100 - cost[i][1]
	if a >= 0 and a % 100 > res:
		res = a % 100
print(res)


(n, s) = map(int, input().split())
maxi = check = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x < s or (x == s and y == 0):
		check = 1
		if maxi < (100 - y) % 100:
			maxi = 100 - y
if check == 0:
	print(-1)
else:
	print(maxi)


def read():
	inputs = input().strip()
	return list(map(int, inputs.split()))

def read_pair():
	return map(int, input().split(' '))
(n, s) = read_pair()
mn = 100
ok = False
for i in range(n):
	(x, y) = read_pair()
	if x < s:
		if y:
			mn = min(y, mn)
	if x < s or (x == s and y == 0):
		ok = True
if not ok:
	print(-1)
else:
	print(100 - mn)


(n, s) = map(int, input().split())
d = [0] * n
c = [0] * n
for i in range(n):
	(d[i], c[i]) = map(int, input().split())
maxc = 0
ok = 0
for i in range(n):
	if d[i] == s and c[i] == 0:
		ok = 1
	elif d[i] < s:
		ok = 1
		if c[i] > 0 and maxc < 100 - c[i]:
			maxc = 100 - c[i]
if ok == 0:
	maxc = -1
print(maxc)


b_data = [int(bd) for bd in input().split()]
(options, money) = (b_data[0], b_data[1])
types = []
maxy = -1
for o in range(options):
	types.append([int(x) for x in input().split()])
for t in types:
	if t[0] < money and t[1] > 0:
		maxy = max(maxy, 100 - t[1])
	elif t[0] <= money and t[1] == 0:
		maxy = max(maxy, 0)
print(maxy)


(n, s) = [int(x) for x in input().split()]
ans = -1
s *= 100
while n > 0:
	(x, y) = [int(x) for x in input().split()]
	k = x * 100 + y
	if k <= s:
		ans = max(ans, (s - k) % 100)
	n -= 1
if ans > -1:
	print(ans)
else:
	print(-1)


(n, s) = [int(x) for x in input().split()]
res = 0
check = False
for i in range(n):
	(x, y) = [int(x) for x in input().split()]
	if s - x > 0 or (s == x and y == 0):
		check = True
	if s - x > 0 and y != 0:
		res = max(res, 100 - y)
if not check:
	print(-1)
	exit()
print(res)


(n, s) = map(int, input().split())
swt = -1
for i in range(n):
	(d, c) = map(int, input().split())
	if s >= d + c / 100:
		if (100 - c) % 100 > swt:
			swt = (100 - c) % 100
print(swt)


(n, s) = [int(i) for i in input().split()]
cur = -1
for i in range(n):
	(x, y) = [int(i) for i in input().split()]
	if 100 * x + y <= s * 100:
		if cur == -1:
			cur = 0
		if 100 > 100 - y > cur:
			cur = 100 - y
print(cur)


import itertools
import math
import random
import time

def timer(f):

	def tmp(*args, **kwargs):
		t = time.time()
		res = f(*args, **kwargs)
		print('Время выполнения функции: %f' % (time.time() - t))
		return res
	return tmp

def genArray(length, lower, upper):
	return [random.randint(lower, upper) for i in range(length)]
(n, s) = map(int, input().split(' '))
array = [list(map(int, input().split(' '))) for i in range(n)]
res = -100
for i in range(n):
	if array[i][0] + array[i][1] / 100 <= s:
		sdacha = 100 - array[i][1]
		if array[i][1] == 0:
			sdacha = 0
		if sdacha > res:
			res = sdacha
if res == -100:
	print(-1)
else:
	print(res)


(n, s) = [int(i) for i in input().split()]
xy = []
for i in range(n):
	xy.append(tuple((int(i) for i in input().split())))
ans = -1
for pair in xy:
	if s > pair[0] or (s == pair[0] and pair[1] == 0):
		ans = max(ans, (100 - pair[1]) % 100)
print(ans)


import itertools
import math
from collections import defaultdict

def input_ints():
	return list(map(int, input().split()))

def solve():
	(n, s) = input_ints()
	ans = -1
	for i in range(n):
		(x, y) = input_ints()
		if x < s or (x == s and y == 0):
			ans = max(ans, (100 - y) % 100)
	print(ans)
solve()


(n, s) = map(int, input().split())
r = -1
while n:
	(x, y) = map(int, input().split())
	if x * 100 + y <= s * 100:
		r = max(r, (100 - y) % 100)
	n -= 1
print(r)


(n, s) = map(int, input().split())
l = []
for i in range(n):
	(x, y) = map(int, input().split())
	if x <= s and y == 0:
		t = 100 - y
		if t < 100:
			l.append(t)
			g = max(l)
		else:
			l.append(0)
	elif x + 1 <= s:
		t = 100 - y
		if t < 100:
			l.append(t)
			g = max(l)
		else:
			l.append(0)
	else:
		l.append(-1)
print(max(l))


(n, s) = map(int, input().split())
arr = []
l = []
for z in range(n):
	(x, y) = map(int, input().split())
	arr.append([x, y])
for i in arr:
	if i[0] < s and i[1] != 0:
		l.append(100 - i[1])
	elif i[0] == s and i[1] == 0 or (i[0] < s and i[1] == 0):
		l.append(0)
if len(l) == 0:
	print(-1)
else:
	print(max(l))


(n, s) = map(int, input().split())
ll = []
for i in range(n):
	l = list(map(int, input().split()))
	if l[0] < s and l[1] != 0:
		ll.append(100 - l[1])
	elif l[0] < s:
		ll.append(0)
	elif l[0] == s and l[1] == 0:
		ll.append(0)
print(max(ll) if len(ll) != 0 else -1)


(n, s) = [int(i) for i in input().strip().split()]
ans = -1
for i in range(n):
	(d, c) = [int(i) for i in input().strip().split()]
	if d < s:
		ans = max(ans, (100 - c) % 100)
	elif d == s and c == 0:
		ans = max(ans, 0)
print(ans)


z = lambda x: map(int, x.split())
(n, s) = z(input())
m = 0
p = -1
for i in range(n):
	(x, y) = z(input())
	if x < s and y > 0 and (100 - y > m):
		m = 100 - y
		p = 1
	elif x <= s and y == 0 and (p == -1):
		p = 1
print(m if p == 1 else -1)


(a, b) = map(int, input().split())
sum = -1
b = b * 100
while a:
	a -= 1
	(s, t) = map(int, input().split())
	c = 100 * s + t
	if b < c:
		continue
	sum = max(sum, (b - c) % 100)
print(sum)


(a, b) = map(int, input().split(' '))
maxx = 0
mark = False
for i in range(a):
	(c, d) = map(int, input().split(' '))
	if 100 * c + d <= 100 * b:
		mark = True
		if d > 0:
			maxx = max(100 - d, maxx)
if mark == True:
	print(maxx)
else:
	print(-1)


from sys import stdin
(n, s) = list(map(int, stdin.readline().rstrip().split(' ')))
maxChange = -1
for _ in range(n):
	(x, y) = list(map(int, stdin.readline().rstrip().split(' ')))
	if x < s:
		if y != 0 and 100 - y > maxChange:
			maxChange = 100 - y
		elif y == 0:
			if 0 > maxChange:
				maxChange = 0
	elif x == s and y == 0:
		if 0 > maxChange:
			maxChange = 0
print(maxChange)


(n, s) = str(input()).split()
n = int(n)
s = int(s)
line = list()
for i in range(n):
	(x, y) = str(input()).split()
	x = int(x)
	y = int(y)
	if s > x or (s == x and y == 0):
		if y > 0:
			line.append(100 - y)
		else:
			line.append(0)
if len(line) > 0:
	print(max(line))
else:
	print(-1)


(n, s) = map(int, input().split())
(mx, fg) = (0, 0)
for i in range(0, n):
	(a, b) = map(int, input().split())
	if b != 0:
		if a + 1 <= s:
			fg = 1
			mx = max(mx, 100 - b)
	elif a <= s:
		fg = 1
if fg == 0:
	print(-1)
else:
	print(mx)


(n, s) = map(int, input().split())
mx = -1
for i in range(n):
	(xi, yi) = map(int, input().split())
	if xi <= s:
		if xi < s:
			mx = max(mx, (100 - yi) % 100)
		elif yi == 0:
			mx = max(0, mx)
print(mx)


sugar_type_amount_and_dollars = input().split(' ')
n = int(sugar_type_amount_and_dollars[0])
s = int(sugar_type_amount_and_dollars[1])
s_cents = s * 100
sweets = []
for _ in range(n):
	price = input().split(' ')
	dollars = int(price[0])
	cents = int(price[1])
	total = dollars * 100 + cents
	if s_cents >= total:
		diff = s_cents - total
		sweets.append(diff % 100)
print(max(sweets) if len(sweets) else -1)


import sys
(n, s) = map(int, sys.stdin.readline().split())
ans = -1
for _ in range(n):
	(x, y) = map(int, sys.stdin.readline().split())
	if y == 0:
		if x <= s:
			ans = max(ans, 0)
	elif x < s:
		ans = max(ans, 100 - y)
print(ans)


def rint():
	return int(input())

def rints():
	return list(map(int, input().split()))
(n, s) = rints()
sw = -1
for _ in range(n):
	(x, y) = rints()
	if (x, y) <= (s, 0):
		sw = max(sw, 100 - y if y > 0 else 0)
print(sw)


import itertools as ittls
from collections import Counter
import re
import math

def sqr(x):
	return x * x

def inputarray(func=int):
	return map(func, input().split())
(N, S) = inputarray()
res = -1
for i in range(N):
	(x, y) = inputarray()
	if x < S or (x == S and y == 0):
		res = max(res, divmod(100 - y, 100)[1])
print(res)


from sys import stdin

def main():
	a = stdin.readline()
	b = a.split()
	c = int(b[0])
	d = int(b[1])
	dulces = -1
	for i in range(c):
		a = stdin.readline()
		b = a.split()
		e = int(b[0])
		f = int(b[1])
		if e < d:
			if f == 0:
				f = 100
			if 100 - f > dulces:
				dulces = 100 - f
		elif e == d:
			if f == 0:
				if f > dulces:
					dulces = f
	print(dulces)
main()


(n, s) = map(int, str.split(input()))
r = -1
for _ in range(n):
	(x, y) = map(int, str.split(input()))
	if x < s or (x == s and y == 0):
		r = max(r, 100 - (y or 100))
print(r)


(n, s) = map(int, input().split())
(r, t) = (100, 0)
for i in range(n):
	(x, y) = map(int, input().split())
	if s > x or (s == x and y == 0):
		t = 1
		if y != 0:
			r = min(r, y)
print(100 - r if t else -1)


r = lambda : map(int, input().split())
(n, d) = r()
d *= 100
m = -1
for _ in range(n):
	(do, c) = r()
	do = do * 100 + c
	if do > d:
		continue
	m = max(m, (d - do) % 100)
print(m)


(n, s) = input().split()
n = int(n)
s = int(s)
p = []
for _ in range(n):
	(x, y) = input().split()
	x = int(x)
	y = int(y)
	if x + y / 100 <= s:
		z = 100 - y
		if z > 0 and y != 0:
			p.append(z)
		elif y == 0:
			p.append(y)
o = len(p)
p.sort()
if o > 0:
	print(p[-1])
else:
	print(-1)


(n, k) = map(int, input().split())
c = 100
y = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if k > a and b != 0 and (b < c):
		c = b
	elif k == a and b == 0:
		y = 1
	elif k > a:
		y = 1
if c != 100:
	print(100 - c)
elif y == 1:
	print('0')
else:
	print('-1')


(n, s) = [int(st) for st in input().split()]
res = -1
for i in range(n):
	(x, y) = [int(st) for st in input().split()]
	if x + y / 100 <= s:
		if y == 0:
			y = 100
		res = max(res, 100 - y)
print(res)


import sys, os

def myreadline():
	testFile = ''
	if testFile:
		if not hasattr(myreadline, 'fTest'):
			myreadline.fTest = open(os.path.join(os.path.dirname(__file__), testFile))
		return myreadline.fTest.readline()
	else:
		return input()

def myreadlineint():
	return [int(x) for x in myreadline().split()]
(n, s) = myreadlineint()
maxKonf = -1
for _ in range(n):
	(d, c) = myreadlineint()
	curKonf = -1
	s100 = s * 100
	d100 = d * 100 + c
	if s100 >= d100:
		sda4a = s100 - d100
		cent = sda4a % 100
		curKonf = cent
	if curKonf > maxKonf:
		maxKonf = curKonf
print(maxKonf)


from collections import deque as de
import math
import sys
import re
from collections import Counter as cnt
from functools import reduce
from typing import MutableMapping
from itertools import groupby as gb
from fractions import Fraction as fr
from bisect import bisect_left as bl, bisect_right as br

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

class My_stack:

	def __init__(self):
		self.data = []

	def my_push(self, x):
		return self.data.append(x)

	def my_pop(self):
		return self.data.pop()

	def my_peak(self):
		return self.data[-1]

	def my_contains(self, x):
		return self.data.count(x)

	def my_show_all(self):
		return self.data

	def isEmpty(self):
		return len(self.data) == 0
arrStack = My_stack()

def decimalToBinary(n):
	return bin(n).replace('0b', '')

def binarytodecimal(n):
	return int(n, 2)

def isPrime(n):
	if n <= 1:
		return False
	if n <= 3:
		return True
	if n % 2 == 0 or n % 3 == 0:
		return False
	i = 5
	while i * i <= n:
		if n % i == 0 or n % (i + 2) == 0:
			return False
		i = i + 6
	return True

def get_prime_factors(number):
	prime_factors = []
	while number % 2 == 0:
		prime_factors.append(2)
		number = number / 2
	for i in range(3, int(math.sqrt(number)) + 1, 2):
		while number % i == 0:
			prime_factors.append(int(i))
			number = number / i
	if number > 2:
		prime_factors.append(int(number))
	return prime_factors

def get_frequency(list):
	dic = {}
	for ele in list:
		if ele in dic:
			dic[ele] += 1
		else:
			dic[ele] = 1
	return dic

def Log2(x):
	return math.log10(x) / math.log10(2)

def getProduct(n):
	product = 1
	while n != 0:
		product = product * (n % 10)
		n = n // 10
	return product

def dupconscount(nums):
	element = []
	freque = []
	if not nums:
		return element
	running_count = 1
	for i in range(len(nums) - 1):
		if nums[i] == nums[i + 1]:
			running_count += 1
		else:
			freque.append(running_count)
			element.append(nums[i])
			running_count = 1
	freque.append(running_count)
	element.append(nums[i + 1])
	return (element, freque)

def isPowerOfTwo(n):
	return math.ceil(Log2(n)) == math.floor(Log2(n))

def checkisap(list):
	d = list[1] - list[0]
	for i in range(2, len(list)):
		temp = list[i] - list[i - 1]
		if temp != d:
			return False
	return True

def ceildiv(x, y):
	return (x + y - 1) // y

def di():
	return map(int, input().split())

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))

def si():
	return list(map(str, input()))

def indic():
	dic = {}
	for (index, value) in enumerate(input().split()):
		dic[int(value)] = int(index) + 1
	return dic
(n, s) = di()
l = []
nn = n
while n:
	n -= 1
	(x, y) = di()
	l.append([x, y])
l.sort()
temp = []
for row in l:
	temp.append(row[0])
ind = bl(temp, s)
if ind == 0:
	if l[0][0] == s and l[0][1] == 0:
		print(0)
	else:
		print(-1)
else:
	mx = 0
	for i in range(min(nn, ind)):
		if l[i][1]:
			diff = 100 - l[i][1]
			if diff > mx:
				mx = diff
	print(mx)


from builtins import int
line1 = input()
lis = line1.split(' ')
n = int(lis[0])
s = int(lis[1])
bestRem = -1
for i in range(n):
	line = input()
	l = line.split(' ')
	val1 = int(l[0])
	val2 = int(l[1])
	if s == val1 and val2 > 0:
		continue
	elif s == val1 and val2 == 0 and (bestRem == -1):
		bestRem = 0
	elif s > val1:
		if bestRem == -1 and val2 == 0:
			bestRem = 0
		elif bestRem < 100 - val2 and val2 != 0:
			bestRem = 100 - val2
print(bestRem)


(n, s) = map(int, input().rstrip().split(' '))
np = 0
sol = 100
d = [0] * n
test = False
for i in range(n):
	(x, y) = map(int, input().rstrip().split(' '))
	if x + y / 100 > s:
		d[i] = -1
	else:
		test = True
		d[i] = y
mi = 1000
for j in d:
	if j == 0:
		j = 100
	if j < mi and j > 0:
		mi = j
if test:
	print(100 - mi)
else:
	print(-1)


(n, s) = map(int, input().split())
l = []
for i in range(n):
	l.append(list(map(int, input().split())))
m = -1
f = 0
for i in l:
	if i[0] < s:
		f = 1
		if i[1] != 0:
			m = max(100 - i[1], m)
	elif i[0] == s:
		if i[1] == 0:
			f = 1
if f == 1:
	m = max(m, 0)
print(m)


__author__ = 'hamed1soleimani'
dat = input().split()
n = int(dat[0])
s = int(dat[1])
sugars = list()
for i in range(n):
	dat = input().split()
	sugars.append((int(dat[0]), int(dat[1])))
buy = False
sweet = 0
for (d, c) in sugars:
	if s * 100 >= d * 100 + c:
		buy = True
		sw = 100 - c
		if 100 > sw > sweet:
			sweet = sw
if buy:
	print(sweet)
else:
	print(-1)


(pl, k) = list(map(int, input().split()))
jam = []
for x in range(pl):
	(fa, p) = list(map(int, input().split()))
	if fa > k:
		pass
	elif fa == k and p == 0:
		jam.append(0)
	elif fa == k and p > 0:
		pass
	elif p == 0:
		jam.append(0)
	else:
		jam.append(100 - p)
if jam == list():
	print(-1)
else:
	print(max(jam))


(n, s) = map(int, input().split(' '))
res = -1
for i in range(n):
	(d, c) = map(int, input().split(' '))
	if s > d or (s == d and c == 0):
		if c == 0:
			res = max(res, 0)
		else:
			res = max(res, 100 - c)
print(res)


(n, s) = map(int, input().split())
res = []
for i in range(n):
	(x, y) = map(int, input().split())
	if x < s and y != 0:
		res.append(100 - y)
	elif x < s:
		res.append(0)
	elif x == s and y == 0:
		res.append(0)
print(max(res) if len(res) != 0 else -1)


(n, s) = [int(i) for i in input().split()]
h = 196787878
sch = []
for i in range(n):
	(d, c) = [int(i) for i in input().split()]
	if s > d:
		if c != 0:
			sch.append(100 - c)
		else:
			sch.append(0)
	if s == d and c == 0:
		sch.append(0)
if len(sch) == 0:
	print(-1)
else:
	print(max(sch))


def sugar(lst, s):
	result = -1
	for elem in lst:
		if elem[0] < s and elem[1] > 0:
			result = max(result, 100 - elem[1])
		elif elem[0] <= s and elem[1] == 0:
			result = max(result, 0)
	return result
(N, S) = [int(i) for i in input().split()]
a = list()
for i in range(N):
	(k, t) = [int(i) for i in input().split()]
	a.append([k, t])
print(sugar(a, S))


(num, sdollars) = input().split(' ')
n = int(num)
s = int(sdollars)
sweets = -1
for i in range(0, n):
	(dollars, cents) = input().split(' ')
	d = int(dollars)
	c = int(cents)
	if s < d:
		continue
	if s == d and c > 0:
		continue
	if c == 0:
		if sweets == -1:
			sweets = 0
		continue
	if 100 - c > sweets:
		sweets = 100 - c
print(sweets)


numbers = input()
n = int(numbers.split(' ')[0])
s = int(numbers.split(' ')[1])
x = []
y = []
flag = 0
candy = 0
for i in range(0, n):
	numbers = input()
	x.append(int(numbers.split(' ')[0]))
	y.append(int(numbers.split(' ')[1]))
for i in range(0, n):
	if x[i] < s:
		flag = 1
		if y[i] != 0 and 100 - y[i] > candy:
			candy = 100 - y[i]
	elif x[i] == s and y[i] == 0:
		flag = 1
if flag == 1:
	print(candy)
else:
	print(-1)


def __starting_point():
	(n, s) = [int(i) for i in input().split()]
	m = -1
	for i in range(n):
		(xi, yi) = [int(j) for j in input().split()]
		if xi < s:
			m = max(m, (100 - yi) % 100)
		if xi == s and yi == 0:
			m = max(m, 0)
	print(m)
__starting_point()


import math
import random
import heapq, bisect
import sys
from collections import deque, defaultdict
from fractions import Fraction
import sys
import threading
from collections import defaultdict
threading.stack_size(10 ** 8)
mod = 10 ** 9 + 7
mod1 = 998244353
import os
import sys
from io import BytesIO, IOBase
sys.setrecursionlimit(300000)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

class TreeNode:

	def __init__(self, k, v):
		self.key = k
		self.value = v
		self.left = None
		self.right = None
		self.parent = None
		self.height = 1
		self.num_left = 1
		self.num_total = 1

class AvlTree:

	def __init__(self):
		self._tree = None

	def add(self, k, v):
		if not self._tree:
			self._tree = TreeNode(k, v)
			return
		node = self._add(k, v)
		if node:
			self._rebalance(node)

	def _add(self, k, v):
		node = self._tree
		while node:
			if k < node.key:
				if node.left:
					node = node.left
				else:
					node.left = TreeNode(k, v)
					node.left.parent = node
					return node.left
			elif node.key < k:
				if node.right:
					node = node.right
				else:
					node.right = TreeNode(k, v)
					node.right.parent = node
					return node.right
			else:
				node.value = v
				return

	@staticmethod
	def get_height(x):
		return x.height if x else 0

	@staticmethod
	def get_num_total(x):
		return x.num_total if x else 0

	def _rebalance(self, node):
		n = node
		while n:
			lh = self.get_height(n.left)
			rh = self.get_height(n.right)
			n.height = max(lh, rh) + 1
			balance_factor = lh - rh
			n.num_total = 1 + self.get_num_total(n.left) + self.get_num_total(n.right)
			n.num_left = 1 + self.get_num_total(n.left)
			if balance_factor > 1:
				if self.get_height(n.left.left) < self.get_height(n.left.right):
					self._rotate_left(n.left)
				self._rotate_right(n)
			elif balance_factor < -1:
				if self.get_height(n.right.right) < self.get_height(n.right.left):
					self._rotate_right(n.right)
				self._rotate_left(n)
			else:
				n = n.parent

	def _remove_one(self, node):
		replacement = node.left or node.right
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = replacement
			else:
				node.parent.right = replacement
			replacement.parent = node.parent
			node.parent = None
		else:
			self._tree = replacement
			replacement.parent = None
		node.left = None
		node.right = None
		node.parent = None
		self._rebalance(replacement)

	def _remove_leaf(self, node):
		if node.parent:
			if AvlTree._is_left(node):
				node.parent.left = None
			else:
				node.parent.right = None
			self._rebalance(node.parent)
		else:
			self._tree = None
		node.parent = None
		node.left = None
		node.right = None

	def remove(self, k):
		node = self._get_node(k)
		if not node:
			return
		if AvlTree._is_leaf(node):
			self._remove_leaf(node)
			return
		if node.left and node.right:
			nxt = AvlTree._get_next(node)
			node.key = nxt.key
			node.value = nxt.value
			if self._is_leaf(nxt):
				self._remove_leaf(nxt)
			else:
				self._remove_one(nxt)
			self._rebalance(node)
		else:
			self._remove_one(node)

	def get(self, k):
		node = self._get_node(k)
		return node.value if node else -1

	def _get_node(self, k):
		if not self._tree:
			return None
		node = self._tree
		while node:
			if k < node.key:
				node = node.left
			elif node.key < k:
				node = node.right
			else:
				return node
		return None

	def get_at(self, pos):
		x = pos + 1
		node = self._tree
		while node:
			if x < node.num_left:
				node = node.left
			elif node.num_left < x:
				x -= node.num_left
				node = node.right
			else:
				return (node.key, node.value)
		raise IndexError('Out of ranges')

	@staticmethod
	def _is_left(node):
		return node.parent.left and node.parent.left == node

	@staticmethod
	def _is_leaf(node):
		return node.left is None and node.right is None

	def _rotate_right(self, node):
		if not node.parent:
			self._tree = node.left
			node.left.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.left
			node.left.parent = node.parent
		else:
			node.parent.right = node.left
			node.left.parent = node.parent
		bk = node.left.right
		node.left.right = node
		node.parent = node.left
		node.left = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	def _rotate_left(self, node):
		if not node.parent:
			self._tree = node.right
			node.right.parent = None
		elif AvlTree._is_left(node):
			node.parent.left = node.right
			node.right.parent = node.parent
		else:
			node.parent.right = node.right
			node.right.parent = node.parent
		bk = node.right.left
		node.right.left = node
		node.parent = node.right
		node.right = bk
		if bk:
			bk.parent = node
		node.height = max(self.get_height(node.left), self.get_height(node.right)) + 1
		node.num_total = 1 + self.get_num_total(node.left) + self.get_num_total(node.right)
		node.num_left = 1 + self.get_num_total(node.left)

	@staticmethod
	def _get_next(node):
		if not node.right:
			return node.parent
		n = node.right
		while n.left:
			n = n.left
		return n

class SegmentTree1:

	def __init__(self, data, default=2 ** 51, func=lambda a, b: a & b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class SegmentTree:

	def __init__(self, data, default=0, func=lambda a, b: a + b):
		self._default = default
		self._func = func
		self._len = len(data)
		self._size = _size = 1 << (self._len - 1).bit_length()
		self.data = [default] * (2 * _size)
		self.data[_size:_size + self._len] = data
		for i in reversed(range(_size)):
			self.data[i] = func(self.data[i + i], self.data[i + i + 1])

	def __delitem__(self, idx):
		self[idx] = self._default

	def __getitem__(self, idx):
		return self.data[idx + self._size]

	def __setitem__(self, idx, value):
		idx += self._size
		self.data[idx] = value
		idx >>= 1
		while idx:
			self.data[idx] = self._func(self.data[2 * idx], self.data[2 * idx + 1])
			idx >>= 1

	def __len__(self):
		return self._len

	def query(self, start, stop):
		if start == stop:
			return self.__getitem__(start)
		stop += 1
		start += self._size
		stop += self._size
		res = self._default
		while start < stop:
			if start & 1:
				res = self._func(res, self.data[start])
				start += 1
			if stop & 1:
				stop -= 1
				res = self._func(res, self.data[stop])
			start >>= 1
			stop >>= 1
		return res

	def __repr__(self):
		return 'SegmentTree({0})'.format(self.data)

class Factorial:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorials = [1, 1]
		self.invModulos = [0, 1]
		self.invFactorial_ = [1, 1]

	def calc(self, n):
		if n <= -1:
			print('Invalid argument to calculate n!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.factorials):
			return self.factorials[n]
		nextArr = [0] * (n + 1 - len(self.factorials))
		initialI = len(self.factorials)
		prev = self.factorials[-1]
		m = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * i % m
		self.factorials += nextArr
		return self.factorials[n]

	def inv(self, n):
		if n <= -1:
			print('Invalid argument to calculate n^(-1)')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		p = self.MOD
		pi = n % p
		if pi < len(self.invModulos):
			return self.invModulos[pi]
		nextArr = [0] * (n + 1 - len(self.invModulos))
		initialI = len(self.invModulos)
		for i in range(initialI, min(p, n + 1)):
			next = -self.invModulos[p % i] * (p // i) % p
			self.invModulos.append(next)
		return self.invModulos[pi]

	def invFactorial(self, n):
		if n <= -1:
			print('Invalid argument to calculate (n^(-1))!')
			print('n must be non-negative value. But the argument was ' + str(n))
			exit()
		if n < len(self.invFactorial_):
			return self.invFactorial_[n]
		self.inv(n)
		nextArr = [0] * (n + 1 - len(self.invFactorial_))
		initialI = len(self.invFactorial_)
		prev = self.invFactorial_[-1]
		p = self.MOD
		for i in range(initialI, n + 1):
			prev = nextArr[i - initialI] = prev * self.invModulos[i % p] % p
		self.invFactorial_ += nextArr
		return self.invFactorial_[n]

class Combination:

	def __init__(self, MOD):
		self.MOD = MOD
		self.factorial = Factorial(MOD)

	def ncr(self, n, k):
		if k < 0 or n < k:
			return 0
		k = min(k, n - k)
		f = self.factorial
		return f.calc(n) * f.invFactorial(max(n - k, k)) * f.invFactorial(min(k, n - k)) % self.MOD

def powm(a, n, m):
	if a == 1 or n == 0:
		return 1
	if n % 2 == 0:
		s = powm(a, n // 2, m)
		return s * s % m
	else:
		return a * powm(a, n - 1, m) % m

def sort_list(list1, list2):
	zipped_pairs = zip(list2, list1)
	z = [x for (_, x) in sorted(zipped_pairs)]
	return z

def product(l):
	por = 1
	for i in range(len(l)):
		por *= l[i]
	return por

def binarySearchCount(arr, n, key):
	left = 0
	right = n - 1
	count = 0
	while left <= right:
		mid = int((right + left) / 2)
		if arr[mid] <= key:
			count = mid + 1
			left = mid + 1
		else:
			right = mid - 1
	return count

def countdig(n):
	c = 0
	while n > 0:
		n //= 10
		c += 1
	return c

def binary(x, length):
	y = bin(x)[2:]
	return y if len(y) >= length else '0' * (length - len(y)) + y

def countGreater(arr, n, k):
	l = 0
	r = n - 1
	leftGreater = n
	while l <= r:
		m = int(l + (r - l) / 2)
		if arr[m] >= k:
			leftGreater = m
			r = m - 1
		else:
			l = m + 1
	return n - leftGreater
(n, s) = map(int, input().split())
ans = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if x == s:
		if y == 0:
			ans = max(ans, 0)
	if x < s:
		if y > 0:
			ans = max(100 - y, ans)
		else:
			ans = max(ans, 0)
print(ans)


import sys
(n, s) = [int(x) for x in sys.stdin.readline().split()]
result = -1
for c in range(n):
	(x, y) = [int(x) for x in sys.stdin.readline().split()]
	t = x
	if y > 0:
		t += 1
	if t <= s:
		a = 100 - y
		if a == 100:
			a = 0
		if a > result:
			result = a
print(result)


import math
(n, s) = map(int, input().split())
max_ = -1
for i in range(n):
	(d, c) = map(int, input().split())
	if c != 0:
		if d + 1 <= s:
			if 100 - c > max_:
				max_ = 100 - c
	elif d <= s:
		if c > max_:
			max_ = 0
print(max_)


(n, s) = list(map(int, input().split()))
ans = -1
for i in range(n):
	(x, y) = list(map(int, input().split()))
	if x == s and y == 0:
		ans = max(ans, 0)
	if x < s:
		ans = max(ans, (100 - y) % 100)
print(ans)


cin = input
(n, s) = map(int, cin().split())
mx = -1
for i in range(n):
	(x, y) = map(int, cin().split())
	if x + min(1, y) <= s:
		mx = max(mx, (100 - y) % 100)
print(mx)


(n, s) = map(int, input().split())
maxi = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if x + y / 100 <= s:
		maxi = max(maxi, 100 - y if y else 0)
print(maxi)


(Inpt1, Inpt2) = list(map(int, input().split()))
Maximum = -1
for i in range(Inpt1):
	(Inpt3, Inpt4) = list(map(int, input().split()))
	if Inpt4 == 0 and Inpt3 <= Inpt2:
		Maximum = max(0, Maximum)
	elif Inpt3 < Inpt2:
		Maximum = max(100 - Inpt4, Maximum)
print(Maximum)


(n, s) = map(int, input().split())
l = sorted((list(map(int, input().split())) for _ in range(n)))
ans = -1
for i in range(n):
	if l[i][1]:
		l[i][0] += 1
	if l[i][0] > s:
		break
	if (100 - l[i][1]) % 100 > ans:
		ans = (100 - l[i][1]) % 100
print(ans)


(n, s) = map(int, input().split())
ma = 0
d = 0
for i in range(n):
	(a, b) = map(int, input().split())
	if a == s and b == 0:
		d = 1
	if a < s:
		d = 1
		if b != 0:
			if abs(100 - b) > ma:
				ma = abs(100 - b)
if d == 0:
	print(-1)
else:
	print(ma)


[n, s] = [int(x) for x in input().split()]
t = [-1]
for i in range(1, n + 1):
	[a, b] = [int(x) for x in input().split()]
	if a + b * 0.01 <= s:
		if b == 0:
			t.append(0)
		else:
			t.append(100 - b)
t.sort(reverse=True)
print(t[0])


(n, s) = [int(i) for i in input().split()]
l = []
for i in range(n):
	(a, b) = [int(i) for i in input().split()]
	if a < s:
		if b != 0:
			l.append(100 - b)
		else:
			l.append(0)
	elif a == s:
		if b == 0:
			l.append(0)
		else:
			pass
if len(l) == 0:
	print(-1)
else:
	print(max(l))


(n, s) = input().split(' ')
s = float(s)
n = int(n)
x = []
y = []
for i in range(n):
	(d, c) = input().split(' ')
	x.append(int(d))
	y.append(int(c))
p = []
for i in range(n):
	p.append(x[i] + y[i] / 100)
newP = p[:]
canBuy = False
for i in range(n):
	if s >= newP[i]:
		canBuy = True
	else:
		y[i] = 100
y.append(100)
minCents = min([i for i in y if i != 0])
maxSweets = 100 - minCents
if canBuy:
	print(maxSweets)
else:
	print(-1)


a = list(map(int, input().split()))
a[1] *= 100
b = []
for i in range(a[0]):
	c = list(map(int, input().split()))
	b += [c[0] * 100 + c[1]]
b = filter(lambda x: x <= a[1], b)
b = [(a[1] - i) % 100 for i in b]
if b:
	print(max(b))
else:
	print(-1)


(a, b) = map(int, input().split())
g = -1
z = 0
for i in range(a):
	(y, x) = map(int, input().split())
	if y < b and g < 100 - x and (x > 0):
		g = 100 - x
		z = 1
	if g == -1 and b >= y:
		if x == 0:
			g = 0
print(g)


(n, s) = [int(val) for val in input().split()]
max = -1
for i in range(n):
	(x, y) = [int(val) for val in input().split()]
	cost = x + y / 100
	if y == 0:
		y = 100
	if s >= cost:
		if (100 - y) % 100 > max:
			max = 100 - y
print(max)


from sys import stdin

def main():
	inp = stdin
	lectura = [int(x) for x in inp.readline().strip().split()]
	dulce = 100
	count = 0
	p = True
	while count < lectura[0]:
		bolsas = [int(x) for x in inp.readline().strip().split()]
		if lectura[1] > bolsas[0] or (lectura[1] == bolsas[0] and bolsas[1] == 0):
			p = False
			if bolsas[1] != 0 and bolsas[1] < dulce:
				dulce = bolsas[1]
		count += 1
	if dulce == 100 and p:
		print(-1)
	elif dulce == 100:
		print(0)
	else:
		print(100 - dulce)
main()


(n, s) = (int(i) for i in input().split())
s *= 100
res = []
for i in range(n):
	(x, y) = (int(i) for i in input().split())
	if s // (x * 100 + y) > 0:
		res.append(((s - (x * 100 + y)) % 100, s // (x * 100 + y)))
res.sort()
if len(res):
	print(res[-1][0])
else:
	print(-1)


(n, s) = input().split()
ans = -1
s = int(s)
for i in range(0, int(n)):
	(a, b) = input().split()
	a = int(a)
	b = int(b)
	if s > a or (s == a and b == 0):
		ans = max(ans, (100 - b) % 100)
print(ans)


(n, m) = map(int, input().split())
l = 101
for i in range(n):
	(a, b) = map(int, input().split())
	if a * 100 + b <= m * 100:
		if b == 0:
			if l == 101:
				l = 100
		else:
			l = min(l, b)
if l == 101:
	print(-1)
else:
	print(100 - l)


(n, s) = map(int, input().split())
L = [list(map(int, input().split())) for _ in range(n)]
P = []
for i in range(n):
	if L[i][0] < s or (L[i][0] == s and L[i][1] == 0):
		P = P + [L[i][1]]
if P == []:
	print(-1)
else:
	m = P[0]
	for i in range(1, len(P)):
		if P[i] and P[i] < m:
			m = P[i]
	if m:
		print(100 - m)
	else:
		print(0)


from sys import stdin

def main():
	num = stdin.readline()
	b = num.split()
	c = int(b[0])
	d = int(b[1])
	maxi = -1
	for i in range(c):
		n = stdin.readline()
		b = n.split()
		e = int(b[0])
		f = int(b[1])
		if e < d:
			if f == 0:
				f = 100
			if 100 - f > maxi:
				maxi = 100 - f
		elif e == d:
			if f == 0:
				if f > maxi:
					maxi = f
	print(maxi)
main()


(n, s) = map(int, input().split())
ma = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if s * 100 >= x * 100 + y and ma < (100 - y) % 100:
		ma = (100 - y) % 100
print(ma)


(n, s) = map(int, input().split())
cent = 0
f = 0
for i in range(n):
	(x, y) = map(int, input().split())
	if x < s and y > 0 and (100 - y > cent):
		f = 1
		cent = 100 - y
	elif x <= s and y == 0:
		f = 1
print(cent if f else -1)


b = []
for _ in input().split():
	b.append(int(_))
n = b[0]
s = b[1]
min1 = -1
b.pop(0)
b.pop(0)
for i in range(0, n):
	for _ in input().split():
		b.append(int(_))
	if s - b[0] >= 1:
		if 100 - b[1] > min1 and 100 - b[1] != 100:
			min1 = 100 - b[1]
		elif 100 - b[1] == 100 and min1 == -1:
			min1 = 0
	elif s - b[0] == 0:
		if 100 - b[1] == 100 and min1 <= 0:
			min1 = 0
	b.pop(0)
	b.pop(0)
print(min1)


(n, s) = list(map(int, input().split()))
x = []
y = []
maximum = 0
k = 0
for i in range(n):
	(a, b) = list(map(int, input().split()))
	x.append(a)
	y.append(b)
for i in range(n):
	if s > x[i] and 100 - y[i] > maximum and (y[i] > 0):
		maximum = 100 - y[i]
	if s < x[i]:
		k += 1
	if s == x[i] and y[i] > 0:
		k += 1
if k == n:
	print(-1)
else:
	print(maximum)


(n, s) = list(map(int, input().split()))
z = []
for i in range(n):
	(k, kk) = input().split()
	c = s * 100 - int(k + kk if len(kk) == 2 else k + '0' + kk)
	z.append(c % 100) if c >= 0 else z.append(-1)
print(max(z) if max(z) != -1 else -1)


gi = lambda : list(map(int, input().split()))
(n, s) = gi()
L = []
for k in range(n):
	temp = gi()
	if temp[0] <= s:
		if temp[1] == 0:
			L.append(0)
		elif temp[0] < s:
			L.append(100 - temp[1])
if not L:
	print(-1)
	exit()
print(max(L))


(n, s) = map(int, input().split())
(x, y) = ([], [])
for i in range(n):
	(a, b) = map(int, input().split())
	x.append(a)
	y.append(b)
max_candy = -1
for i in range(n):
	if y[i]:
		if s > x[i]:
			max_candy = max(max_candy, 100 - y[i])
	elif s >= x[i]:
		max_candy = max(max_candy, 0)
print(max_candy)


from math import fmod
(n, s) = input().split()
n = int(n)
s = int(s)
price = []
for i in range(n):
	(d, c) = input().split()
	if int(d) < s or (int(d) == s and int(c) == 0):
		price.append((100 - int(c)) % 100)
if not price:
	print(-1)
else:
	print(max(price))


import sys
(n, s) = map(int, sys.stdin.readline().split())
ans = -1
for i in range(n):
	(x, y) = map(int, sys.stdin.readline().split())
	if x * 100 + y <= s * 100:
		if y == 0:
			ans = max(ans, 0)
		else:
			ans = max(ans, 100 - y)
print(ans)


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, copy, functools
import random
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20
eps = 1.0 / 10 ** 10
mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI():
	return [list(map(int, l.split())) for l in sys.stdin.readlines()]

def LI_():
	return [int(x) - 1 for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def LS():
	return sys.stdin.readline().split()

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def pf(s):
	return print(s, flush=True)

def pe(s):
	return print(str(s), file=sys.stderr)

def main():
	(n, s) = LI()
	aa = [LI() for _ in range(n)]
	r = -1
	t = s * 100
	for (x, y) in aa:
		u = x * 100 + y
		k = t - u
		if k < 0:
			continue
		p = k % 100
		if r < p:
			r = p
	return r
print(main())


string = input()
numbers = string.split()
a = int(numbers[0])
b = int(numbers[1]) * 100
sweets = [-1]
for x in range(a):
	string = input()
	numbers = string.split()
	d = int(numbers[0])
	c = int(numbers[1])
	m = d * 100 + c
	if b >= m:
		sweets.append(-c % 100)
print(max(sweets))


(n, s) = map(int, input().split())
a = [[int(i) for i in input().split()] for j in range(n)]
ans = -1
for i in a:
	if i[0] + min(1, i[1]) <= s:
		ans = max(ans, (100 - i[1]) % 100)
print(ans)


(n, s) = map(int, input().split())
s *= 100
ans = -1
for i in range(n):
	(x, y) = map(int, input().split())
	cost = x * 100 + y
	if s < cost:
		continue
	sd = (s - cost) % 100
	ans = max(ans, sd)
print(ans)


(n, s) = map(int, input().split())
mim = 0
d = 0
l = []
for i in range(n):
	(a, b) = map(int, input().split())
	if a * 100 + b <= s * 100:
		mim = s * 100 - (a * 100 + b)
		d = mim % 100
		l.append(d)
if len(l) > 0:
	print(max(l))
else:
	print('-1')


(n, s) = map(int, input().split())
d = -1
for i in range(n):
	(x, y) = map(int, input().split())
	if x == s and y != 0:
		continue
	if x > s:
		continue
	if y == 0 and d == -1:
		d = 0
		continue
	if y == 0 and d != -1:
		continue
	if 100 - y > d:
		d = 100 - y
print(d)


(a, b) = map(int, input().split())
s = -1
for _ in ' ' * a:
	(x, y) = map(int, input().split())
	if x < b and y != 0:
		s = max(s, 100 - y)
	if x <= b and y == 0:
		s = max(s, 0)
print(s)


a = input().split()
mon = int(a[1])
l = []
for i in range(int(a[0])):
	p = input().split()
	l.append(p)
change = []
t = 0
for i in range(int(a[0])):
	if int(l[i][0]) == mon:
		if int(l[i][1]) == 0:
			change.append(0)
	if int(l[i][0]) < mon:
		s = 100 - int(l[i][1])
		if int(l[i][0]) // mon > 1:
			s = s * (int(l[i][0]) // mon)
		if s > 100:
			change.append(s % 100)
		elif s == 100:
			change.append(0)
		elif s < 100:
			change.append(s)
if len(change) > 0:
	print(max(change))
else:
	print(-1)


(n, s) = map(int, input().strip().split())
ans = 0
found = False
for i in range(n):
	(x, y) = map(int, input().strip().split())
	amt = x + y / 100
	if amt <= s:
		found = True
		if y > 0:
			ans = max(ans, 100 - y)
print(-1 if not found else ans)


try:
	while True:
		(n, s) = map(int, input().split(' '))
		res = -1
		while n:
			(x, y) = map(int, input().split(' '))
			if s * 100 >= 100 * x + y:
				res = max(res, (100 - y) % 100)
			n -= 1
		print(res)
except EOFError:
	pass


x = input()
lol = False
n = ''
s = ''
for letter in x:
	if letter == ' ':
		lol = True
	else:
		if lol == False:
			n += letter
		if lol == True:
			s += letter
lol = False
n = int(n)
s = 100 * int(s)
change = ''
sugars = []
price = ''
changes = []
for i in range(n):
	sugar = input()
	for letter in sugar:
		if letter == ' ':
			lol = True
		else:
			if lol == False:
				price += letter
			if lol == True:
				change += letter
	sugars.append(100 * int(price) + int(change))
	lol = False
	change = ''
	price = ''
for item in sugars:
	if s >= item:
		left = (item - 1) % 100
		right = 99 - left
		changes.append(right)
if len(changes) == 0:
	ans = -1
else:
	ans = max(changes)
print(ans)


def io():
	(n, s) = map(int, input().split())
	sugar = []
	for _ in range(n):
		(x, y) = map(int, input().split())
		dollar = x * 100 + y
		sugar.append(dollar)
	return [n, s * 100, sugar]

def solve():
	(n, s, sugar) = io()
	ans = -1
	for i in sugar:
		if s >= i:
			change = (s - i) % 100
			ans = max(change, ans)
	print(ans)
solve()


from sys import stdin, stdout
input = stdin.readline
(n, s) = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
ma = 0
f = False
for i in a:
	if i[0] < s:
		if 100 - i[1] > ma and i[1] > 0:
			ma = 100 - i[1]
		f = True
	elif i[0] == s and i[1] == 0:
		f = True
if ma == 0 and (not f):
	stdout.write('-1')
else:
	stdout.write(str(ma))


(n, s) = [int(x) for x in input().split()]
ans = -1
for i in range(n):
	(x, y) = [int(t) for t in input().split()]
	if x < s or (x == s and y == 0):
		if y:
			ans = max(ans, 100 - y)
		else:
			ans = max(ans, 0)
print(ans)


from sys import stdin
b = list()
rango = list()
c = list()
v = list()
casos = stdin.readline().strip().split()
for i in range(int(casos[0])):
	linea = stdin.readline().strip().split()
	b.append(linea)
for t in range(len(b)):
	if int(b[t][0]) + int(b[t][1]) / 100 <= int(casos[1]):
		v.append(b[t])
for y in range(len(v)):
	c.append(v[y][1])
c = [int(f) for f in c]
c.sort()
if len(v) == 0:
	print(-1)
else:
	for g in range(len(c) - 1):
		if c[0] == 0:
			del c[0]
	res = 100 - int(c[0])
	if c[-1] == 0:
		print(0)
	else:
		print(res)


cin = input
(n, s) = map(int, cin().split())
mx = -1
for i in range(n):
	(x, y) = map(int, cin().split())
	if x <= s:
		mx = max(mx, not s - x >= 0) if not y else max(mx, 100 - y) if x + 1 <= s else mx
print(int(mx))


(n, m) = map(int, input().split())
maxe = -1
for i in range(n):
	(dol, cent) = map(int, input().split())
	dol_new = dol * 100 + cent
	if m * 100 >= dol_new:
		maxe = max(maxe, (m * 100 - dol * 100 - cent) % 100)
print(maxe)


(n, s) = map(int, input().split())
mx = -1
for i in range(n):
	(t, c) = map(int, input().split())
	if t < s and c != 0:
		mx = max(mx, 100 - c)
	if t < s and c == 0:
		mx = max(mx, 0)
	elif t == s and c == 0:
		mx = max(mx, 0)
print(mx)


import os
import sys
from math import *
from collections import *
from bisect import *
from io import BytesIO, IOBase

def vsInput():
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def value():
	return tuple(map(int, input().split()))

def array():
	return [int(i) for i in input().split()]

def Int():
	return int(input())

def Str():
	return input()

def arrayS():
	return [i for i in input().split()]
(n, s) = value()
ans = inf
f = -1
for _ in range(n):
	(x, y) = value()
	if x < s and y != 0:
		ans = min(y, ans)
	if x + y / 100 <= s:
		f = 0
if ans != inf:
	print(100 - ans)
else:
	print(f)


def readln():
	return tuple(map(int, input().split()))
(n, s) = readln()
ans = 0
ok = False
for _ in range(n):
	(d, c) = readln()
	if d + (c > 0) <= s:
		ok = True
		if c > 0:
			ans = max(ans, 100 - c)
print(ans if ok else -1)


(n, s) = input().split()
n = int(n)
s = int(s)
(x, y) = ([], [])
for i in range(n):
	(x1, y1) = input().split()
	if int(x1) + int(y1) / 100 > s:
		continue
	x.append(int(x1))
	y.append(int(y1))
x2 = len(x)
if x2 == 0:
	print(-1)
else:
	y2 = min(y)
	if y2 > 0:
		print(100 - y2)
	else:
		sm = max(y)
		if sm == y2:
			print(y2)
		else:
			for i in range(x2):
				if y[i] != y2 and y[i] < sm:
					sm = y[i]
			print(100 - sm)


def solve(n, s, cost):
	s = 100 * s
	best = -1
	for (x, y) in cost:
		p = x * 100 + y
		if s >= p:
			best = max(best, (s - p) % 100)
	return best
(n, s) = map(int, input().split())
cost = [list(map(int, input().split())) for _ in range(n)]
print(solve(n, s, cost))


(n, s) = list(map(int, input().split()))
ans = -1
for i in range(n):
	(Xi, Yi) = list(map(int, input().split()))
	if Yi == 0 and Xi <= s or (Yi != 0 and Xi < s):
		ans = max(ans, (100 - Yi) % 100)
print(ans)


(n, s) = map(int, input().split())
res = []
for sugar in range(n):
	(dollars, cents) = map(int, input().split())
	if dollars < s:
		if 100 - cents < 100:
			res.append(100 - cents)
	if dollars <= s and cents == 0:
		res.append(0)
if len(res) == 0:
	print(-1)
else:
	print(max(res))


(n, s) = [int(j) for j in input().split()]
val = -1
for j in range(n):
	(x, y) = [int(k) for k in input().split()]
	if x < s:
		if val == -1:
			if y == 0:
				val = 0
			else:
				val = 100 - y
		elif y != 0:
			val = max(val, 100 - y)
	elif x == s and y == 0:
		if val == -1:
			val = 0
		else:
			val = max(val, 0)
print(val)


from sys import stdin

def main():
	(n, s) = map(int, stdin.readline().strip().split())
	s *= 100
	l = [-1]
	for _ in range(n):
		(x, y) = map(int, stdin.readline().strip().split())
		y += 100 * x
		if s >= y:
			l.append((s - y) % 100)
	return max(l)
print(main())