#P50124. 「LibreOJ Round #8」Matrix

「LibreOJ Round #8」Matrix

Description

Alex is playing a game with Ball. There is a blank matrix MM with nn lines and nn columns. Alex and Ball take turns to mark one of the matrix elements with his own sign (Alex’s sign is called AA and Ball’s sign is called BB). Ball goes first.
After a round of game (a round means that Ball and Alex operates once each in order), if there exists a permutation p[1..n]p[1..n] satisfies that for each i[1,n] i \in [1,n],M[i][p[i]]=AM[i][p[i]]=A, Alex wins immediately.
After n2/2\lfloor n^2 /2 \rfloor rounds, if Alex hasn’t won, Ball wins instead.
Notice that whenever anyone tries to mark a marked matrix element(because of forgetting), he will lose the game immediately.
Sly Ball thinks of a way to interfere Alex. He decides to operate long time after the Alex’s last operation so that Alex may forget about the previous operations.
Now you get this message and want to know two things for a given nn:

  • whether Alex has winning strategy if he remembers all the previous operations
  • whether Alex has winning strategy if he forgets all the previous operations, and only knows Ball's last operation each time.

Ball always knows all their previous operations.

Input Format

Read from the standard input.
This first line contains a single integer TT which means the number of the test cases.
The following TT lines, each line contains one integer nn which means the size of the matrix.

Output Format

Write to the standard output.
For each test case, output two lines of Yes or No.
The first line means whether Alex can win for sure If he remembers the previous operations.
The second line means whether Alex can win for sure If he forgets the previous operations.

Sample 1

2
1
2
No
No
No
No
2
1
2
No
No
No
No

Constraints

For all test cases, 1n10181\leq n \leq 10^{18},1T1001 \leq T \leq 100 .

Detailed constraints are as follows (blank grids denote the same constraints as mentioned above):

Subtask Score (percentage) nn
11 10 3\leq 3
22 40 100\leq 100
33 20 106\leq 10^6
44 30 1018\leq 10^{18}