Redirecting to
NADOS

Modular Fast Exponentiation

1. You are given a number x.
2. You are given another number n.
3. You are required to calculate x raised to the power n mod 10^9 + 7 in logn complexity.
Input Format
The first line contains the integer x and n.
Output Format
Output an integer in a line containing x^n mod 10^9+7.
Question Video
Constraints
1 <= x <= 10^9
0 <= n <= 10^9
Sample Input
10 5 
Sample Output
100000


  • Asked in Companies
  • Related Topics






Video Solution

Code Solution

Run
 
Run
Id Name