-->
当前位置:首页 > 题库

PROGRAMMING:Matrix

Luz5年前 (2021-05-10)题库409
Give you an N * N matrix, fill in the number of 1 to N * N in order, for example N = 5, the matrix is as follows
![ 4AD3FD2F-DDE7-4113-BF7D-E71E57273309.png](~/c9ce58f5-fb29-4c48-8352-4a6b6853e86d.png)
Now let you connect the midpoints of the adjacent two sides, and then only keep the numbers they enclose in the closed graphics area, then the matrix becomes
![ 7C32F25E-1E11-4AFE-BF4A-1484A911688C.png](~/077b1e85-cce6-4c75-9f19-f1562b2a1bcf.png)
Now ask you for the sum of all the elements of the changed matrix.
###Input format:
Input the first line of an integer T (1 <= T <= 100)
Next, there is a group test data, and each set of test data is input with an integer N (3 <= N <= 10000)
Guaranteed input n is odd
###Output format:
For each set of test data, output the corresponding answer
###Input example:
Here is a set of inputs. For example:
```in
two
three
five
```
###Output example:
The corresponding output is given here. For example:
```out
twenty-five
one hundred and sixty-nine
```







answer:If there is no answer, please comment