Finding the ways
Practice
0 (0 votes)
Mathematics
Medium
Modular arithmetic
Number theory
Problem
64% Success 497 Attempts 30 Points 2s Time Limit 256MB Memory 1024 KB Max Code

You are given an integer $$N$$ and a value $$k$$. You need to find a minimum number $$X$$ which when multiplied to $$N$$ results in the value of $$N ^ {1 / k}$$ as an integer. 

For example let $$N = 6$$ and $$K = 2$$ , then the answer will be $$6$$ because $$6 \times 6 = 36$$ and if we calculate $$36 ^{1/2}$$ it is equal to $$6$$ which is an integer.

Input
The first line contains two space-separated values $$N$$ and $$k$$ as input.

Output
Print the minimum number $$X$$ modulo $$10^9 + 7$$

Constraints
$$1 \le N \le 10^{12}$$
$$1 \le k \le 10^{12}$$

Please login to use the editor

You need to be logged in to access the code editor

Loading...

Please wait while we load the editor

Loading...
Results
Custom Input
Run your code to see the output
Submissions
Please login to view your submissions
Similar Problems
Points:30
1 votes
Points:30
2 votes
Points:30
8 votes
Tags:
MathNumber TheoryModulus ArithmeticC++