All submissions for this problem are available.
Karatsuba loves big numbers.
One night he created an infinite table (yes, he is that awesome). The table is such that:
A[i,j] = (i+1)^j (i>=1, j>=1) ( (i+1) to the power j ) )
He told his friend about his new awesome table. To test Karatsuba’s mathematical prowess, his friend asked him a question about his table.
He asked Karatsuba to tell him, if we write all the numbers of the table in increasing order, what would be the kth largest number in this series?
First line: T (number of test cases)
Each of the next T lines , contains a number K
For each test case, a single number on every line (answer to the ith test case)
- 1 ≤ T ≤ 1000
- 1 ≤ K ≤ 10^15
Input: 3 1 2 3 Output: 2 3 4
|Time Limit:||1 sec|
|Source Limit:||50000 Bytes|
|Languages:||C, CPP14, JAVA, PYTH, PYTH 3.6, PYPY, CS2, PAS fpc, PAS gpc, RUBY, PHP, GO, NODEJS, HASK, SCALA, D, PERL, FORT, WSPC, ADA, CAML, ICK, BF, ASM, CLPS, PRLG, ICON, SCM qobi, PIKE, ST, NICE, LUA, BASH, NEM, LISP sbcl, LISP clisp, SCM guile, JS, ERL, TCL, PERL6, TEXT, SCM chicken, PYP3, CLOJ, FS|
Fetching successful submissions
If you are still having problems, see a sample solution here.