// Update the code below to solve this problem
#include <iostream>
#include <string>
#include<cmath>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int N,X;
cin>>N>>X;
int op=pow(2,X);
cout<<op/(2*N)<<endl;
}
return 0;
}
Your mistake is, that you do not divide correctly. I cannot tell you more without giving you the solution. If you are stuck, you can find a solution here:
minimal fix solution
#include <iostream>
#include <string>
#include<cmath>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int N,X;
cin>>N>>X;
int op=pow(2,X);
cout<<op/pow(2,N)<<endl; //fix: divide by pow(2,N) instead of (2*N)
}
return 0;
}