Ուղարկել | Բոլոր լուծումները | Լավագույն լուծումները | Վերադառնալ ցուցակին |
ACM0303 - SQUARE |
Do you know a 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.
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.
The input will begin with a single integer P on the first line, indicating the number of cases that will 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.
You should process all integers and for each integer l, determine the total number of squares which can be seen in an image of a grid square of length l.
You can assume that no operation overflows a 32-bit integer.
Output.
For 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.
Sample test.
N |
stdin |
stdout |
1 |
4 1 2 3 4 |
1 5 14 30 |
Ավելացրեց. | Հրանտ Հովհաննիսյան |
Ամսաթիվ. | 2016-07-22 |
Ժամանակի սահմանափակումը. | 1s |
Ծրագրի տեքստի սահմանափակումը. | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Լեզուներ. | Բոլորը բացի ASM32 ASM64 GAWK CLPS CLOJURE D ERL FSHARP FORTRAN GOSU HASK ICON ICK NEM NIM OBJC-CLANG PICO PIKE PYPY PYPY3 PY_NBC RUST SCM guile CHICKEN SED TCL WHITESPACE |
Աղբյուրը. | Beninese Collegiate Programming Contest, 2016 |