1997 Woburn Computer Programming Challenge
Current work in cryptography involves (among other things) computing large prime numbers and computing powers of numbers modulo these large primes. Work in this area has resulted in the practical use of results from number theory and other branches of mathematics once considered to be only of theoretical interest. This problem involves the efficient calculation of integer roots of numbers.
Given an integer
Input Specification
The first line of the input is
The input consists of
Output Specification
For each set of values for
Sample Input
3
2
16
3
27
7
4357186184021382204544
Sample Output
4
3
1234
Comments