Boruto and Sarada
All submissions for this problem are available.
Boruto and Sarada both desperately wanted to become Hokage. The Academy in the Leaf Village seeing their desperation decided to conduct a test, just to keep them motivated for their goal.
In the test, they were given 2 integers X and Y, and the task was to check if it is possible to express X as a sum of Y distinct positive integers (i.e. as the sum of integers greater than 0). Both were intelligent enough to answer this question within a few seconds. Are you ?
The first line of the input contains an integer T denoting the number of test cases. The description of T test cases follows.
Each test case consists of a single line of input containing 2 space-separated integers X and Y as described in the problem statement.
For each test case, output a single line containing either YES or NO denoting the answer to the problem.
Information to Score Partial Points
- For 5% of the score, it is guaranteed that T,X,Y ≤ 10.
- For further 10% of the score, it is guaranteed that T ≤ 105, X,Y≤ 10.
- For the rest of the 85% of the score, no extra guarantees. That is, T ≤ 105, X,Y ≤ 109.
- 1 ≤ T ≤ 105
- 1 ≤ X,Y ≤ 109
5 2 Output: YES
Example case 1. 5 can be expressed as the sum of 2 integers in many ways as follows :- 1+4 or 2+3.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, rust, SCALA, swift, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, kotlin, PERL6, TEXT, SCM chicken, CLOJ, COB, FS|
Fetching successful submissions