Submit | All submissions | Best solutions | Back to list |
TCOUNT3 - Counting Triangles III |
Have you felt bored when counting triangles?
Like TRICOUNT and TCOUNT2, we define the LEVEL of a triangle as in the following illustrative image:
And now we will continue defining the LEVEL of a hexagram. It's called level N hexagram if it’s joined by 12 triangles, each one is a level N triangle.
Task: All you have to do is to count all triangles in the level N hexagram.
Input
The first line of the input contains an integer T - the number of test cases and T lines follow. Each line contains an integer N which is the level of the hexagram in that test case.
Output
For each test case, you should write a separate line: the number of triangles in the level N hexagram. (All answers will fit within the range of a 64-bit positive integer)
Example
Input: 1 1 Output: 20
Added by: | nha.duong |
Date: | 2007-08-07 |
Time limit: | 1s |
Source limit: | 128B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | ASM32 C CPP C99 D PAS-GPC PAS-FPC PERL PYTHON RUBY |
Resource: | Trần Huy Hưng |
hide comments
2015-09-11 18:05:09
Cannot see the picture .. :( |
|
2013-07-11 08:11:20 ওয়াসী (Wasi)
ok got ac with c++ but py2.7 gives tle :( Last edit: 2013-07-13 16:15:04 |
|
2013-05-30 04:57:01 phpMyAdmin
formula :P |
|
2010-05-07 13:52:27 Reborn In Fire...
when there are such strict limits on size, atleast give some hints!!!! |