AtCoder Beginner Contest 189
B
Alcoholic
AtCoder
⌀ 249
原题
← AC →
翻译中…

Problem Statement

翻译中…

Takahashi had $N$ glasses of liquor.

翻译中…

The amount and alcohol percentage of the $i$-th liquor were $V_i$ milliliters and $P_i$ percent by volume, respectively.

翻译中…

Takahashi gets drunk when his alcohol intake exceeds $X$ milliliters.

翻译中…

Which of the $N$ liquors was he drinking when he gets drunk? If he was not drunk even after drinking all the liquors, print -1 instead.

翻译中…

Constraints

翻译中…
  • All values in input are integers.
  • $1 \leq N \leq 10^3$
  • $0 \leq X \leq 10^6$
  • $1 \leq V_i \leq 10^3$
  • $0 \leq P_i \leq 100$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N X
V_1 P_1
\vdots
V_N P_N

翻译中…

Output

翻译中…

If Takahashi got drunk when drinking the $i$-th liquor, print $i$. If he was not drunk even after drinking all the liquors, print -1 instead.

翻译中…

样例

Input #1
2 15
200 5
350 3
Output #1
2
The $1$-st liquor contains $200\times \dfrac{5}{100}=10$ milliliters of alcohol. The $2$-nd liquor contains $350\times \dfrac{3}{100}=10.5$ milliliters of alcohol. His alcohol intake exceeds $15$ milliliters for the first time when drinking the $2$-nd liquor.
Input #2
2 10
200 5
350 3
Output #2
2
When his alcohol intake is exactly $X$ milliliters, he is still not drunk.
Input #3
3 1000000
1000 100
1000 100
1000 100
Output #3
-1
He seems to be immune to alcohol.
题目信息
题号
abc189_b
时间限制
2 s
内存限制
1024 MB

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