Limits 1s, 512 MB

A little boy Towhid is good at mathematics. He solves a lot of mathematical equation regularly.

He is studying magic square attentively more than one week. But he is facing some difficulties with magic square. He didn’t find yet any equation to find sum of any row or any column or any diagonal in a magic square. But he knows that you are a good programmer in Metropolitan University.

Now, he needs your help to find the sum of any row or column or main diagonal in any magic square.

A magic square is NN grid where is the number of cells on each Side filled with distinct positive integers in the range of 1 to NN such that each cell contains a different integer and the sum of the integers in each row, column and main diagonal is equal. Normal magic squares of all sizes can be constructed except 2×22×2 grid.

Input

The first line contains a single integer tt (1t10001 ≤ t ≤ 1000) — the number of test cases.

Each of the next tt lines contains a single integer NN (3N10003 ≤ N ≤ 1000), the column or row size of the magic square.

Output

For every test case, output one integer in a separate line in the format “Case X: Y” (w/o quotes) where XX is the number of the test case starting from 1 and YY is the sum of the any row or any column or any main diagonal in N×NN \times N magic square.

Sample

InputOutput
3
3
4
1000
Case 1: 15
Case 2: 34
Case 3: 500000500

Submit

Login to submit.

Statistics

99% Solution Ratio
RabelAhmedEarliest, Jul '17
Mili290Fastest, 0.0s
AlWarisLightest, 0 B
Nusab19Shortest, 59B
Toph uses cookies. By continuing you agree to our Cookie Policy.