SPOJ EIGHTS

1030 - Triple Fat Ladies
http://www.spoj.pl/problems/EIGHTS/

Summary
Given a number k, find the kth number (indexed from 1) whose cube ends in 888.

Explanation
Consider a number $$n = w*10^3 + x*10^2 + y*10 + z$$ and now find the cube of $$n$$. If carry out this operation carefully, you would understand how to solve the problem. Here $$x$$, $$y$$, $$z$$ are digits from 0 to 9, while $$w$$ is any arbitrary number.

Gotchas
Use unsigned long long to contain the answer.

Input
The first line of the input contains an integer $$T$$ representing the number of test cases to follow. Each test case consists of a single line containing a single integer $$1 \le k \le 2000000000000$$. 1 1

Output
192