Advertisement
Guest User

Untitled

a guest
Apr 19th, 2021
9,938
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.25 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int n,k;
  6. const int MOD=1e9+7;
  7.  
  8. int main()
  9. {
  10.     int t;
  11.     scanf("%d",&t);
  12.     while(t--)
  13.     {
  14.         scanf("%d %d",&n,&k);
  15.         long long ans=1;
  16.         for(int i=0;i<k;i++) ans=(ans*n)%MOD;
  17.         printf("%lld\n",ans);
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement