Difficulty:628
Expand

Learn the building blocks of programming languages
Take our free programming courses and learn to solve problems like these.
Start Learning

Divisible Duel

Alice loves working with numbers. One day, she takes two integers XX and YY (YXY \ge X) and becomes curious about the numbers between them.

She looks at all integers between XX and YY (inclusive) that are divisible by XX.
Among these numbers, she separates them into even and odd numbers.

Let the sum of all even numbers Alice has be SevenS_{even}, and the sum of all odd numbers she has be SoddS_{odd}.

If SevenSoddS_{even} \ge S_{odd}, Alice will be happy; otherwise, she will be sad.
Alice wants to know whether she will be happy or not.

Input Format

  • The first line contains a single integer TT — the number of test cases.
  • Each of the next TT lines contains two integers XX and YY, representing the lower and upper bound of integers Alice looked at.

Output Format

For each test case, print the answer on a new line: YES if Alice will be happy, otherwise NO.

You may print each character of the answer in uppercase either or lowercase (for example, the strings YES, yEs, yes, and yeS will all be treated as identical).

Constraints

  • 1T1041 \leq T \leq 10^4
  • 1X,Y1001 \leq X,Y \leq 100

Sample 1:

Input
Output
3
1 4
3 9
4 100
YES
NO
YES

Explanation:

Test case 11: Alice has X=1X = 1 and Y=4Y = 4.
The multiples of XX in this range are 1,2,3,41, 2, 3, 4.
So, Seven=2+4=6S_{even} = 2+4 = 6, and Sodd=1+3=4S_{odd} = 1+3 = 4.
Since SevenSoddS_{even} \ge S_{odd}, Alice is happy.

Test case 22: Alice has X=3X = 3 and Y=9Y = 9.
The multiples of XX in this range are 3,6,93, 6, 9. So, Seven=6S_{even} = 6, and Sodd=3+9=12S_{odd} = 3+9 = 12.
Since Seven<SoddS_{even} \lt S_{odd}, Alice is not happy.


More Info
Time limit1 secs
Memory limit1.5 GB
Source Limit50000 Bytes

Author(s)
Tester(s)
Editorialist(s)
#include <bits/stdc++.h>
using namespace std;
int main() {
// your code goes here
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Visualize Code