EIGHTS  Triple Fat Ladies
Pattern Matchers have been designed for various sorts of patterns. Mr. HKP likes to observe patterns in numbers. After completing his extensive research on the squares of numbers, he has moved on to cubes. Now he wants to know all numbers whose cube ends in 888.
Given a number k, help Mr. HKP find the k^{th} number (indexed from 1) whose cube ends in 888.
Input
The first line of the input contains an integer t, the number of test cases. t test cases follow.
Each test case consists of a single line containing a single integer k (1 <= k <= 2000000000000).
Output
For each test case, output a single integer which denotes the k^{th} number whose cube ends in 888. The result will be less than 2^{63}.
Example
Input: 1 1 Output: 192
hide comments
Mayank:
20150528 15:27:31
I did this question by generating the series and observing the pattern but is there any logic by number theory? Last edit: 20150528 15:28:43 

Harsh Vardhan Ladha:
20150526 09:48:45
Lol the pattern :D 

biswas:
20150520 20:28:50
solution hidden in the word "PATTERN"...Think Think 

pk:
20150518 07:47:31
nice question... Ac in first go... :) 

John Jost:
20150418 16:23:06
I feel dirty... Did it initially with an entirely too slow algorithm but that let me see the pattern which made this a trivial problem. 

Pradd:
20150416 16:54:19
AC on second.. Don't forget to use long long in C.. For large numbers, instead of segmentation fault you got a weird output which gives WA.. 

hareesh:
20150414 08:11:43
AC on first go :)


arjun:
20150327 19:41:34
Test Cases:


Tony T.:
20150326 08:02:05
For c++ I had to use long long to meet the 2000000000000 limit 

Maverick:
20150315 17:24:11
those using JAVA, there's no need to use BigInteger. long is more than enough.Just think. Last edit: 20150315 17:24:32 
Added by:  Matthew Reeder 
Date:  20061030 
Time limit:  1.197s 
Source limit:  30000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ERL JSRHINO NODEJS PERL6 VB.NET 
Resource:  AlKhawarizm 2006 