Submit | All submissions | Best solutions | Back to list |
Problem hidden
MBLKY - Mobile Key |
Please look in the following sequence:
1 2 3
4 5 6
7 8 9
Let, its our normal Mobile numeric Key pattern. in 1st line consits 1 2 3, in 2nd line 4 5 6....
if we change this pattern as :
1 2 3
6 5 4
7 8 9
12 11 10
13 14 15
18 17 16
and so on...
and increase those number upto 10^18, what will be nth line ?
here 5th line is 13 14 15.
Input
The first line of the input gives the number of test cases, T(1>=T<=10^5). T test cases follow. Each consists of one line with a Single Positive number N(1>=N<=10^18) .
Output
For each test case, output one line containing Case #x: n1 n2 n3
where x
is the test case number (starting from 1) and n1, n2, n3 is the 1st , 2nd and 3rd number of Nth line .
Make sure that, you are print new line after each output .
See sample input output for more clarify .
Example
Input: 3
2
3
5
Output:
Case #1: 6 5 4 Case #2: 7 8 9 Case #3: 13 14 15
Problem Setter : Adnan Sarker (Dept. of CSE)
Bangladesh University of Business and Technology(BUBT)
3 |
2 |
3 |
5 |
Added by: | Murad |
Date: | 2016-05-04 |
Time limit: | 1s |
Source limit: | 50000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ASM64 GOSU JS-MONKEY |
Resource: | Adnan Sarker |