TCOUNT2 - Counting Triangles II

no tags 

We define the LEVEL of a triangle as in the following illustrative image:


And we continue defining the LEVEL of a hexagon. It's called level N hexagon if it’s joined by 6 triangles, each one is a level N triangle.


Task: All you have to do is to count all triangles in the “level N” hexagon.

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 hexagon in that test case.

Output

For each test case, you should write a seperate line: the number of triangles in the “level N” hexagon. (All answers will fit within the range of a 64-bit positive integer)

Example

Input:
1
1

Output:
6
Be careful with certain languages

hide comments
(Tjandra Satria Gunawan)(曾毅昆): 2015-02-04 10:01:52

I can't see the image too!
EDIT: image fixed by changing the *.pl to *.com; the issue is with *.pl connection isn't secure (said my browser).
--Francky--> I knew that (and wrote it to admins), but I didn't change only to keep the resource field intact. You should have rewrote it !? ;-) Thanks by the way.
Did one of your script can search every .pl in problem description body ? I think there should be not so many...
=[tjandra]=> I didn't make it yet, it will be easy to make the script, but it would make about 6000 HTML request (7× more request than updating TJANDRA page). By the way here I attach an image with *.pl, if you want resource field. Can you see the image?

EDIT(Tjandra): Seems that the *.pl is ok if using reguar "HTTP" not "HTTPS"

(Francky) ⇒ 1) I can see this image using Firefox but not using Opera, nor chromium.
2) By resource field, I mean the line with "Resource: Trần Huy Hưng". I can't edit body without breaking this field, and you ? Did you have to rewrite it ?

=[tjandra]=> Oh, sorry for my misunderstanding. Yes, I have to re-write the resource field, before I edit problem body, I copy the "resource field" HTML code using ([ctrl]+[shift]+[C]) compatible with both chrome and firefox, then paste it on resource box when editing the problem body.

→(Francky)⇒ Thanks for the tip. Here's mine in return. With my Linux keyboard layout, [AltGr]+[numpad 6] gives →, and with [shift] more, I have ⇒. It is easy to get as well ↙↓↘→↗↑↖←↔↕, ⇙⇓⇘⇒⇗⇑⇖⇐⇔⇕ ÷×−+ ¿¡…
And I propose you to shrink this comment, as the issue is solved here.

Last edit: 2015-02-04 23:22:34
MaHmOuD.: 2015-02-03 20:08:28

Images are broken.. i can't see them.

(Francky, 03/02/2015 - 21:22 GMT+1) ⇒ I can see them. Can you (or anybody else) confirm you can't see them ?
Edit(21:25) : using FireFox I can see. Using Opera I can't !!!

Last edit: 2015-02-03 21:50:18
numerix: 2010-01-28 15:04:00

The result for n=1000000 is correct, the result for n=5555555 is wrong. The correct result doesn't fit into a 64-bit integer.

Last edit: 2010-01-28 15:04:40
anshuman mishra: 2010-01-25 15:50:27

i,m too getting same answer for (1000000 --> 3500002250000500000) and (5555555 -->
15990167947078224888). is these answers are correct?


Added by:nha.duong
Date:2007-08-06
Time limit:0.100s
Source limit:300B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:ASM32 C CPP C99 D PAS-GPC PAS-FPC
Resource:Trần Huy Hưng