#include #include using namespace std; using LL = long long; using ULL = unsigned long long; #define rep(i,n) for(int i=0; i<(n); i++) const ULL M = 998244353; ULL powm(ULL a, ULL i){ if (i == 0) return 1; ULL res = powm(a * a % M, i / 2); if (i % 2 == 1) res = res * a % M; return res; } void loop(){ ULL N, K; cin >> N >> K; ULL ans = (powm(2, K) + M - 1) % M; ans = ans * N % M; ans = ans * powm(2, K * (N - 1)) % M; cout << ans << endl; } int main(){ int T; cin >> T; while (T--) loop(); return 0; }