Equal Coins Problem Code: EQUALCOIN codechef Answer

Equal Coins  Problem Code: EQUALCOIN codechef November challenge Answer  Scroll Down for Answer

November Challenge 2021 Division 3 (Rated)  » Equal Coins

Equal Coins 

Problem Code: EQUALCOIN

Add problem to Todo list

Submit

Read problem statements in Bengali, Russian, Mandarin and Vietnamese as well.

Chef has X coins worth 1 rupee each and Y coins worth 2 rupees each. He wants to distribute all of these X+Y coins to his two sons so that the total value of coins received by each of them is the same. Find out whether Chef will be able to do so.


Input Format

The first line of input contains a single integer T, denoting the number of testcases. The description of T test cases follows.

Each test case consists of a single line of input containing two space-separated integers X and Y.

Output Format

For each test case, print "YES" (without quotes) if Chef can distribute all the coins equally and "NO" otherwise. You may print each character of the string in uppercase or lowercase (for example, the strings "yEs", "yes", "Yes" and "YES" will all be treated as identical).


Constraints

1≤T≤103

0≤X,Y≤108

X+Y>0

Subtasks

Subtask 1 (100 points): Original constraints

Sample Input 1 

4

2 2

1 3

4 0

1 10

Sample Output 1 

YES

NO

YES

NO  

Explanation

Test case 1: Chef gives each of his sons 1 coin worth one rupee and 1 coin worth two rupees.


Test case 3: Chef gives each of his sons 2 coins worth one rupee.




 



Post a Comment

0 Comments