Vedant and his Hidden Array solution codechef- Vedant has a hidden array of NN elements. Given the bitwise AND of all elements of the array, determine whether the total sum of the elements is odd, even or cannot be determined.

Vedant and his Hidden Array solution codechef

Vedant has a hidden array of NN elements. Given the bitwise AND of all elements of the array, determine whether the total sum of the elements is odd, even or cannot be determined.

Input Format Vedant and his Hidden Array solution codechef

  • The first line of each input contains TT – the number of test cases. The test cases then follow.
  • The only line of each test case contains two space-separated integers NN and AA – the number of elements in the hidden array and the bitwise AND of all the elements in the hidden array.

Output Format

For each test case, output Even if the sum of all elements in the hidden array is even, Odd if the sum of all elements in the hidden array is odd, or Impossible if the parity cannot be determined.

Note: You may print each character of the string in uppercase or lowercase (for example, the strings eVenEvEneven and EVEN will all be treated as identical).

Constraints Vedant and his Hidden Array solution codechef

  • 1T100001≤T≤10000
  • 1N1091≤N≤109
  • 0A1090≤A≤109

Sample Input 1 

3
1 11
1 2
74120341 829182732

Sample Output 1  Vedant and his Hidden Array solution codechef

Odd
Even
Impossible

Leave a Comment

Your email address will not be published.