#3451. Packing Under Range Regulations
Packing Under Range Regulations
Packing Under Range Regulations
题目描述
Solve the following problem for test cases.
There are boxes numbered and balls numbered .
Each box can contain at most one ball.
Determine whether it is possible to put all balls in the boxes so that the following condition will be satisfied.
For each integer from through , the ball numbered is in a box numbered between and (inclusive).
输入格式
Input is given from Standard Input. The first line is in the following format:
Then, test cases follows, each of which is in the following format:
输出格式
Your output should have lines.
In the -th line, print if it is possible to put all balls in the boxes so that the condition will be satisfied in the -th test case in the input, and print otherwise.
The checker is case-insensitive; it will accept both uppercase and lowercase letters.
2
3
1 2
2 3
3 3
5
1 2
2 3
3 3
1 3
999999999 1000000000
Yes
No
提示
The sum of across the test cases in one input is at most .This input contains two test cases.
In the -st test case, the following way to put the three balls would satisfy the condition, so we should print .
Put Ball in Box . Put Ball in Box . Put Ball in Box .
In the -nd test case, there is no way to put the five balls to satisfy the condition, so we should print .
标签: AtCoder|abc214E
来源
AtCoder|abc214E