Counting Triangles

3.1

11 votes
Basic Programming, Open, Approved, Easy, Mathamatics
Problem

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

Time Limit: 2
Memory Limit: 256
Source Limit:
Editor Image

?