#include <bits/stdc++.h>
#define ll long long int
#define ld long double
using namespace std;
void mainSolve()
{
ll n, k;
cin >> n >> k;
ll ans = (pow(2, n) - 1ll) * (pow(2, n) - 2ll);
cout << ans << endl;
}
int main()
{
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
int t;
cin >> t;
while (t--)
{
mainSolve();
}
return 0;
}