All submissions for this problem are available.
Inspired by V Anand, Chef decided to learn to play chess. Believe me when I say that he mastered the game in a week!!! Looking at his enormous potential, Anand invited him to be his second, on a condition that Chef should solve a problem. Can you help Chef with this task?
You’re given a N x N chess board.
- If N < 8, Chess board will contain only the pieces and pawns limited by that number.
Eg. 2 x 2 board will have just a Knight and a Rook with two pawns. (see image below)
- If N=8, It is a normal chessboard. (see image below)
- If N>8, The chess pieces repeat after every 8 squares. eg 10 x 10 board would have an extra 2 pawns, one extra Rook and an extra Knight. (see image below)
Find the number of possible 2-move combinations if white were to take two consecutive chances without letting Black to play.
The first line of the input contains an integer T denoting the number of test cases. Then T number of lines follow, taking N, the size of the chess board for each test case.
For each test case, Output the number of possible 2-move combinations for each test case in a new line (T lines of output), if white were to take 2 consecutive chances without letting black to play.
- 0 < T ≤ 101
- 0 < N ≤ 101
In a 2 x 2 Board, none of the pieces would be able to move rendering the total number of combinations to be 0
In a 3 x 3 Board, Total number of 2-move combinations come out to be 21.
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, PYP3|
Fetching successful submissions
If you are still having problems, see a sample solution here.