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
tor_el:
20170317 14:34:22
if you want to handle the large numbers in c++ try storing and printing them as a string Last edit: 20170317 14:35:31 

tor_el:
20170316 17:30:35
Last edit: 20170316 17:31:33 

ANKIT JAIN:
20170314 18:15:35
AC in one go :) 

ameyanator:
20170301 08:16:06
My solution in c++ gave a wrong ans. Coded the same thing in java and got an AC! lol 

ankitmas67:
20170204 10:18:46
AC in one go ...just find the pattern


phrs_91:
20170123 21:18:03
LOL!! damm easy >>>o(1).....use spoj toolkit(http://spojtoolkit.com/test/EIGHTS ) to find formula for this problem!!!!


aditya:
20170101 20:48:43
good pattern finding problem 

scorpion_ajay:
20161224 11:16:21
finally 20th, learned a lot :) 

vengatesh15:
20161223 10:04:57
Easy Pattern .. 

c_zenvi01:
20161223 06:00:29
Find the first 5 sequence, get the very easy pattern, implement a junior high school math formula, AC in one go. Last edit: 20161223 06:05:06 
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 