Submit | All submissions | Best solutions | Back to list |
AZOOZ - Azooz |
Azooz is a trainee in acmASCIS Level 1 and he just got his Mid Year Vacation. Since he is a naughty boy he often goes to the kitchen when no one at home to play with matches (and to eat of course :D), after many failed attempts to burn down the House, Azooz got bored and wanted to do something new with the matches.
The Idea Azooz got is that he builds larger triangles using equal sized triangles formed by the matches he got, so a simple triangle with only one level needs only three matches and another one with two levels needs 9 matches and so on.
The two figures illustrate the examples discussed above, and you should know the number of matches Azooz needs to complete his triangle.
Input
First line of input contains number of test cases T (1 < T < 50), followed by T lines each of which contains non-negative integer N, in which N < 100, N denotes the level which Azooz wants to build the triangle.
Output
For each test case print"Case_#i:_X" where "i" is the case number (starting with 1), "X" is number of matches needed to build intended triangle and "_" is a space. Each test case should be on a separate line.
Example
Input: 2 1 2 Output: Case #1: 3 Case #2: 9
Added by: | Sharaf |
Date: | 2013-02-07 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All |
Resource: | 2013 acmASCIS Level 1 Contest |
hide comments
2013-02-14 15:56:13 Ankur Ahuja
How am I getting TLE on this question ? |
|
2013-02-13 20:13:38 rb
easy one.... |
|
2013-02-13 20:13:38 ɥsǝןǝǝu
same as http://www.spoj.com/problems/CRDS/ |