Compute a power b
Given 2 numbers - a and b, evaluate ab.
Input Format
First line of input contains T - number of test cases. Its followed by T lines, each line containing 2 numbers - a and b, separated by space.
Constraints
-
30 points
- 1 <= T <= 1000
- 0 <= a <= 106
- 0 <= b <= 103
-
70 points
- 1 <= T <= 1000
- 0 <= a <= 106
- 0 <= b <= 109
Output Format
For each test case, print ab, separated by new line. Since the result can be very large, print result % 1000000007
Sample Input 0
Sample Output 0
Compute a power b
Given 2 numbers - a and b, evaluate ab.
Input Format
First line of input contains T - number of test cases. Its followed by T lines, each line containing 2 numbers - a and b, separated by space.
Constraints
30 points
70 points
Output Format
For each test case, print ab, separated by new line. Since the result can be very large, print result % 1000000007
Sample Input 0
Sample Output 0