|
|||
SquareDo you know the game called “La cave aux énigmes”? One of its questions is to find the number of squares contained in a grid square of length l. A grid square of length 4 will look like this:
The total number of squares that can be seen in this image is 30. Your task is to find the total number of squares which can be seen in an image of a grid square of length l. Input SpecificationThe first line of the input contains a single integer P, which is the number of data sets that follow. The remaining lines of the input will consist of one integer l per line, which is the grid square length. All integers will be less than 1 000 000 and greater than 0. Output SpecificationFor each integer l, you should output the total number of squares which can be seen in an image of a grid square of length l, with one line of output for each line of input. You can assume that no operation overflows a 32-bit integer. Sample Input
Output for Sample Input
|
|||
University of Debrecen; Faculty of Informatics; v. 09/30/2024 |