In a magical forest, there exists N bamboos that don’t quite get cut down the way you would expect.
Originally, the height of the $i^{th}$ bamboo is equal to $h_i$. In one move, you can push down a bamboo and decrease its height by one, but this move magically causes all the other bamboos to increase in height by one.
If you can do as many moves as you like, is it possible to make all the bamboos have the same height?
The first line of input is T – the number of test cases.
The first line of each test case contains an integer $N(1 ≤ N ≤ 10^5)$ the number of bamboos.
The second line contains N space-separated integers $h_i(1 ≤ h_i ≤ 10^5)$ the original heights of the bamboos.
For each test case, output on a single line “yes” (without quotes), if you can make all the bamboos have the same height, and “no” otherwise.
1 | 2 |
1 | yes |
As we all know, if you subtract a certain number n from a and add n to b, then only if (a - b) % 2 = 0
can make the a = b;
So our goal is to find whether there is a difference between two words that is not even.
1 |
|