#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { long long n, k; cin >> n >> k; long long x = 2; long long y = k; long long ans = 1; while (y > 0) { if ((y & 1) == 1) { ans = ans * x % 998244353; } x = x * x % 998244353; y >>= 1; } ans = (ans + 998244352) % 998244353; x = 2; y = n - 1; long long ans1 = 1; while (y > 0) { if ((y & 1) == 1) { ans1 = ans1 * x % 998244353; } x = x * x % 998244353; y >>= 1; } x = ans1; y = k; ans1 = 1; while (y > 0) { if ((y & 1) == 1) { ans1 = ans1 * x % 998244353; } x = x * x % 998244353; y >>= 1; } ans *= ans1; ans %= 998244353; ans *= n; ans %= 998244353; cout << ans << endl; } }