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 grid where is the number of cells on each Side filled with distinct positive integers in the range of 1 to 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 grid.
The first line contains a single integer () — the number of test cases.
Each of the next lines contains a single integer (), the column or row size of the magic square.
For every test case, output one integer in a separate line in the format “Case X: Y” (w/o quotes) where is the number of the test case starting from 1 and is the sum of the any row or any column or any main diagonal in magic square.
Input | Output |
---|---|
3 3 4 1000 | Case 1: 15 Case 2: 34 Case 3: 500000500 |