DCP-74: Mobile Key Back to All Problems

Beginner Beginners Problems > Ad-hoc


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 consists 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 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. See sample input output for more clarification. Sample Input ------------ 3 2 3 5 Sample Output ------------- Case #1: 6 5 4 Case #2: 7 8 9 Case #3: 13 14 15


Problem Setter:

Adnan Sarker

Please login to submit solution to this problem.

Problem Limits

Language Time Limit (seconds)
C 1.00
C++ 1.00
C++14 1.00
C# 3.00
Go 3.00
Java 3.00
JavaScript 3.00
Objective-C 3.00
Perl 3.00
PHP 3.00
Python 3.00
Python3 3.00
Ruby 3.00
VB.Net 3.00

Problem Stats

294/604

Solve/Submission

Ranking

# User Language Timing
01 Masum_ice Cpp14 0.05s
02 rezaul_karim Cpp14 0.05s
03 afzalul Cpp14 0.05s
04 Mr_KAJOL Cpp14 0.05s
05 nazmul_bzs Cpp14 0.05s
06 soumitro_cse1604114 Cpp14 0.05s
07 Rifat121 Cpp14 0.05s
08 Ehsanul_Fahad Cpp 0.05s
09 Robbinb1993 Cpp 0.05s
10 Bhuiyan C 0.05s
11 sajib_kumar_biswas C 0.06s
12 Nasif_44th C 0.06s
13 rabbicse Cpp 0.06s
14 Azizul_cse27 Cpp 0.06s
15 Morass Cpp14 0.06s
16 Antor_Sarker_Sabuj Cpp 0.06s
17 Utshas Cpp 0.06s
18 wayne6172 Cpp 0.06s
19 tanjilaorpe C 0.06s
20 souravahmed C 0.06s
21 _JaHid_ C 0.06s
22 abdulmukit Cpp 0.06s
23 maruf089 C 0.06s
24 Mushfiq1604123 Cpp 0.06s
25 Sakif_1604124 Cpp 0.06s
26 upol_vai Cpp14 0.06s
27 Sudipta_Nath Cpp14 0.06s
28 shifat1604112 Cpp14 0.06s
29 ashish_pondit Cpp14 0.06s
30 1604099_ishtiaq Cpp14 0.06s
31 Koushik54 Cpp14 0.06s
32 smriad Cpp14 0.06s
33 sumaiya710 C 0.06s
34 Alamgir_1604069 Cpp14 0.06s
35 cinmoy98 Cpp14 0.06s
36 rabiulrafi01 Cpp14 0.06s
37 Foysal_36 Cpp14 0.06s
38 Sabiha_1604070 C 0.06s
39 opu1604073 Cpp14 0.06s
40 SakibAlamin Cpp14 0.06s
41 DynamicOvi Cpp 0.06s
42 Avijeet Cpp14 0.06s
43 Eucalyptus Cpp14 0.06s
44 USB16 Cpp14 0.06s
45 jayed_al_hasan Cpp14 0.06s
46 neel71 C 0.06s
47 leenaiitju Cpp14 0.06s
48 gulzar Cpp14 0.06s
49 Mehedi07 Cpp14 0.06s
50 return_SS Cpp14 0.06s
Feedback

Your feedback is our precious!



Or call +88 02 9853138 for support