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 kth 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 kth number whose cube ends in 888. The result will be less than 263.
Example
Input: 1 1 Output: 192
hide comments
saurabhpthk:
2021-08-21 15:46:08
for JAVA use "long" datatype..
|
|
yasser1110:
2021-02-19 10:02:44
@fawad That's because your are printing 0 in the front in your 1st solution. |
|
ayush_06:
2021-01-08 21:08:48
Ac in 1st time.... |
|
fawad:
2020-07-12 13:41:02
cout << front << last << endl; gave wrong answer, but 1000LL*front+(long long)last gave ac. i wonder why weather it waits for endline or not. |
|
ttaahhssiinn:
2020-06-21 16:36:44
a fun fact why is that name triple fat ladies!!
|
|
pradeep_7:
2020-05-20 14:03:04
Hint :
|
|
prashantc595:
2020-05-06 09:09:26
ac in first go !!
|
|
landi58:
2020-04-30 20:31:26
Just AP.. a=192, d=250;
|
|
trulyness:
2020-04-18 11:10:35
Tips to solve this problem:
|
|
manish_thakur:
2019-11-11 11:36:11
ac in first go ( happened to me first time), find the pattern |
Added by: | Matthew Reeder |
Date: | 2006-10-30 |
Time limit: | 1.197s |
Source limit: | 30000B |
Memory limit: | 1536MB |
Cluster: | Cube (Intel G860) |
Languages: | All except: ERL JS-RHINO NODEJS PERL6 VB.NET |
Resource: | Al-Khawarizm 2006 |