spoj#PIRACON. Pyramidal Constructions
Pyramidal Constructions
Humberto is a great Egyptian architect. In Egypt pyramid sculptural constructions were as common as ornaments. Pharaoh has asked Humberto to build N pyramids throughout Egypt. Humberto is very stingy when it comes to construction costs, so he always buys the exact necessary number of materials needed to complete his work.
Tural Pyramids are built using smallest pyramids of "level 1", that are used as building blocks for higher levels. Stacking pyramids of "level 1" to create higher-level structures, leave gaps. Special parts, called "Tringus", are used to cover these gaps. They are of triangular shape, designed by Humberto to perfectly fill the gaps on piramid sides.
For example, a pyramid of "Level 2" is constructed as follows: We are using a total of 6 pyramids of "level 1" (see the picture above). That leaves 4 gaps at the sides and we need 4 "Tringus" fo fill them. In total 10 pieces.
Humberto asks us to help to calculate the total number and "Tringus" number of pieces needed for a pyramid of level K.
Input
First line contains integer T, number of test cases. Following N lines, each containing an integer K, the level of the piramid.
Output
You must print "Pyramid E. Nro# i: ", followed by the total number of parts used (both pyramids of "level 1" and "Tringus"). In the next line print "Tringus: ", followed by the number of "Tringus" used.
Example
Input: 2 1 4</p>Output: Pyramid E. Nro# 1: 1 Tringus: 0 Pyramid E. Nro# 2: 68 Tringus: 24
Constraints
1<= T <= 10^4
1<= K <= 10^6
original statement(Spanish): Here