# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
19390 |
2016-02-24T11:09:09 Z |
camille |
Σ (kriii4_P2) |
C++ |
|
167 ms |
1716 KB |
#include <iostream>
using namespace std;
typedef long long lld;
lld a,x,mod=1e9+7,t;
lld foo(lld idx){
if(idx==1) return a;
lld k = foo(idx/2)%mod;
if(idx%2) return (((k*k)%mod)*a)%mod;
return (k*k)%mod;
}
int main(){
cin>>t;
while(t--){
cin>>a>>x;
x%=mod, a%=mod;
cout<<(x*foo(mod-2))%mod<<endl;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
167 ms |
1716 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |