P2293 [HNOI2004] High-Precision m-th Root
Description
Xiaohua's team is developing a high-precision scientific computing software suite. Some simple parts such as high-precision addition/subtraction and multiplication/division have already been completed. The remaining part, assigned to Xiaohua, is computing the high-precision real $m$-th root.
Because taking the root of a rational number may produce an irrational number, this task is quite challenging. For now, we only implement the first step: take an integer-order root of a natural number, obtain a non-negative root, and ignore the fractional part of the result—just truncate it to an integer.
Given the input specifying the degree of the root and the integer to be rooted, the program should compute the truncated non-negative root.
Input Format
The input consists of two lines, each containing an integer, with no extra spaces.
- The first line contains a positive integer $m$, the degree of the root.
- The second line contains an integer $n$, the number to take the root of.
Output Format
Output a single line containing one number: the truncated result of the root.
Explanation/Hint
[Constraints]
For all testdata: $0 \le n \le 10^{10000}, 1 \le m \le 50$.
Translated by ChatGPT 5