Board Game

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?
Problem Statement
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 2move combinations if white were to take two consecutive chances without letting Black to play.
align="middle">
Input
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.
Output
For each test case, Output the number of possible 2move 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.
Constraints
 0 < T ≤ 101
 0 < N ≤ 101
Example
Input:
2
2
3
Output:
0
21
Explanation
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 2move combinations come out to be 21.
Author:  c_cube_iist 
Tags  c_cube_iist 
Date Added:  28022015 
Time Limit:  1 sec 
Source Limit:  50000 Bytes 
Languages:  C, CPP14 
Comments
 Please login at the top to post a comment.
SUCCESSFUL SUBMISSIONS
Fetching successful submissions
HELP
If you are still having problems, see a sample solution here. 