Final Over

Esmay_1803017 RUET CodeSmash 2020
Limits 1s, 512 MB

This is ICC World Cup Final and the match is between Bangladesh and Australia. The match goes down to the final over(5050th over). Now Australia is bating and they need rr runs to win. The captain of Bangladesh, Tamim Iqbal wants to use a bowler who can make the win.

The bowling stats of all the 1111 players will be given. Each player's stat is denoted by pp (overs that he bowled before the final over) and xx (opponent scored in his overs). Note that, in an ODI match, a bowler can bowl maximum 1010 overs.

Only if a bowler doesn’t complete his bowling quota and his run per over is strictly smaller than the required runs rr, then we can say this bowler might win the match.

Pantu is watching the match. He is so excited that he wants to make predictions about this match. But as he is not good at prediction, he wants your help.

Input

First line of input contains an integer rr (1r36){(1 \le r \le 36)}- the required run of Australia to win.

The next 1111 lines will contain 22 space separated integers pp and xx (0p10,0x36×p){(0 \le p \le 10, 0 \le x \le 36 \times p)} - stats of each player of Bangladesh. For making things simpler and clear, extra runs are avoided.

Output

For each player of Bangladesh, print Yes in a line, if the player can make the win, otherwise print No in a line. You can assume that, if a player didn’t bowl at least one over, he can’t make the win whatever the required run is.

Sample

InputOutput
27
0 0
1 27
5 1
9 56
5 56
5 6
7 42
8 124
7 96
3 55
1 28
No
No
Yes
Yes
Yes
Yes
Yes
Yes
Yes
Yes
No

As the first player never bowled, he can’t make the win.


Submit

Login to submit.

Statistics

94% Solution Ratio
user.325730Earliest, 1M ago
SabbasachiSutradharFastest, 0.0s
user.325730Lightest, 131 kB
aNkanpy.pritomShortest, 210B
Toph uses cookies. By continuing you agree to our Cookie Policy.