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
kenobi:
20170618 19:22:14
Any ideas how one can find the pattern easely without spoj toolkit? Thx to toolkit got AC 

itachi_2016:
20170612 23:56:05
Haha 3 lines of code.... 

corotoex:
20170610 15:46:26
Don't give up :) I struggled with this many hours and at times I thought too complexly. Last edit: 20170610 15:48:33 

sandeep_4141:
20170609 12:14:08
In c++ use boost multiprecision 57 line code !! 

awanesh:
20170530 12:16:49
should have given 2 test cases 

masterbios:
20170528 15:37:34
very bad explanation :(


ramesh_961:
20170524 16:27:27
Got it!! But I don't see any good in this pattern!! What is relation b/w 888 and the logic?? How we get logic without seeing 1st few test cases in spoj tool kit?? What is the relation b/w Cubes or 888 and 250?? 

Simran Saha:
20170522 06:26:15
Required more test cases....at least one more :P


sagnik_66:
20170518 16:31:51
Very easy! Lol!! Good Pattern, though! 

ayush_mawandia:
20170328 15:35:38
AC in 1 go :)

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 