Coins

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Zahhak, the enemy of Jamshid, has captured Jamshid's daughters, Arnavaz and Shahrnaz. But he decided to offer them an opportunity to free themselves by solving a puzzle. 

Zahhak has an 8×88 \times 8 chessboard with cells labeled from 00 to 6363, as in the figure. He has put a coin on each of the 6464 cells. The cell with label cc has a special coin which is physically identical to the other coins, but it is cursed. Each coin is facing either heads or tails. 

Zahhak invited the sisters to dinner to describe the puzzle: after the dinner, the sisters should go to different rooms. Then Zahhak goes to Arnavaz's room, presents her the chessboard and tells her the value of cc (the label of the cell containing the cursed coin). Arnavaz cannot change the position of the coins but can flip (turn over) at least 11 and at most kk coins. She might flip the same coin several times. Then Zahhak goes to the other room and presents the chessboard to Shahrnaz. If she finds the cursed coin, both sisters will be freed. The sisters can agree on a strategy during the dinner, but cannot communicate afterward.

Your task is to help the sisters solve Zahhak's puzzle.

제한

  • 1T10001 \leq T \leq 1000,
  • 0c630 \leq c \leq 63.