Skip to content

Compute a power b #2

Description

@vardhanrao

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

4
5 2
1 10
2 30
10 10

Sample Output 0

25
1
73741817
999999937

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions