Root of the Problem
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 122.174 megabytes
Given positive integers b and n, find an integer a such that a^n
is as close as possible to b. (The result a is an approximation to the n-th root of b.)
Note that a^n
may be less than, equal to, or greater than b.
Input
Consists of one or more pairs of values for b and n. Each pair appears on a single line, delimited by a single space. A line specifying the value zero for both b and n marks the end of the input. The value of b will be in the range 1 to 10^6
(inclusive), and the value of n will be in the range 1 to 9 (inclusive).
Output
For each pair b and n print a as defined above on a line by itself.
Examples
Input #1
Answer #1
Submissions 847
Acceptance rate 40%