Counting Triangles
Practice
3.1 (11 votes)
Basic programming
Open
Approved
Easy
Mathamatics
Problem
68% Success 7054 Attempts 20 Points 2s Time Limit 256MB Memory 50 KB Max Code

Abhimanyu simply drew two triangles, as shown in the picture below-
Drawing Level 1
He says this, Level 1 Triangles.

Then he drew two more triangles, as shown in the picture below-
Drawing Level 2
He says this, Level 2 Triangles.

Similarly he defined Level 3, 4, 5, ..., N Triangles. You simply need to tell him total no. of triangles in Level N Triangle.

Input:
First line contains number of test cases T. Each test case contains a single integer the level of triangle N.

Output:
For each test case print total number of triangles.

Constraints:
There are three types of test files.
Type1:
1 <= T <= 105
1 <= N <= 106
Type2:
1 <= T <= 103
106 < N <= 1012
Type3:
1 <= T <= 102
1012 < N <= 1016

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:20
1 votes
Tags:
EasySimple-math
Points:20
926 votes
Tags:
Ad-HocMathematicsEasy
Points:20
7 votes
Tags:
Ad-HocMathematicsOpenApprovedEasy