https://hack.codingblocks.com/contests/c/384/759
This is question and this is my code why this is uncorrect?
#include<bits/stdc++.h>
using namespace std;
unsigned long long tavan(int a,int b){
if(b==0)return 1;
unsigned long long result=tavan(a,b/2);
result *=result;
if(b&1){
result=result*a;
}
return result;
}
int main() {
int t;cin >> t;
for(int i=0;i<t;++i){
int k,n;cin >> k >> n;
unsigned long long res=0;
res=tavan(k,n-k);cout << res << endl;
}
return 0;
}