Codeforces Round 264 (Div. 2)
A
Caisa and Sugar
Codeforces
1200
原题
←B →
翻译中…

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.

翻译中…

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.

翻译中…

样例

Input #1
5 10
3 90
12 0
9 70
5 50
7 0
Output #1
50
InputCopy OutputCopy
Input #2
5 5
10 10
20 20
30 30
40 40
50 50
Output #2
-1
InputCopy OutputCopy
题目信息
题号
463A
时间限制
1 s
内存限制
256 MB
标签
暴力
模拟

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。