#pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #ifndef MODINT_HPP #define MODINT_HPP #include template struct ModInt { using u64 = unsigned long long; using i64 = long long; u64 d; ModInt(const i64 x = 0) : d((x % p + p) % p){}; ModInt(const ModInt &) = default; ModInt operator+(ModInt x) const { if (d + x.d >= p) return ModInt(d + x.d - p); else return ModInt(d + x.d); }; ModInt operator-(ModInt x) const { if (d - x.d < 0) return ModInt(d - x.d + p); else return ModInt(d - x.d); }; ModInt operator*(ModInt x) const { return ModInt(d * x.d); } ModInt operator/(ModInt x) const { ModInt inv = 1; u64 exp = p - 2; while (exp) { if (exp & 1) inv *= x; x *= x; exp >>= 1; } return ModInt(d * inv.d); } ModInt operator+() { return *this; }; ModInt operator-() { return ModInt(-d); }; ModInt &operator+=(ModInt x) { return *this = *this + x; }; ModInt &operator-=(ModInt x) { return *this = *this - x; }; ModInt &operator*=(ModInt x) { return *this = *this * x; }; ModInt &operator/=(ModInt x) { return *this = *this / x; }; ModInt operator+(const i64 x) const { return *this + ModInt(x); }; ModInt operator-(const i64 x) const { return *this - ModInt(x); }; ModInt operator*(const i64 x) const { return *this * ModInt(x); }; ModInt operator/(const i64 x) const { return *this / ModInt(x); }; ModInt operator+=(const i64 x) { return *this = *this + x; }; ModInt operator-=(const i64 x) { return *this = *this - x; }; ModInt operator*=(const i64 x) { return *this = *this * x; }; ModInt operator/=(const i64 x) { return *this = *this / x; }; }; template ModInt

operator+(const long long x, const ModInt

y) { return ModInt

(x) + y; }; template ModInt

operator-(const long long x, const ModInt

y) { return ModInt

(x) - y; }; template ModInt

operator*(const long long x, const ModInt

y) { return ModInt

(x) * y; }; template ModInt

operator/(const long long x, const ModInt

y) { return ModInt

(x) / y; }; template std::ostream &operator<<(std::ostream &stream, const ModInt

mi) { return stream << mi.d; }; template std::istream &operator>>(std::istream &stream, ModInt

&mi) { long long a; stream >> a; mi = ModInt

(a); return stream; }; #endif #define _overload(_1, _2, _3, _4, name, ...) name #define _rep1(Itr, N) _rep3(Itr, 0, N, 1) #define _rep2(Itr, A, B) _rep3(Itr, A, B, 1) #define _rep3(Itr, A, B, S) for(i64 (Itr) = A; (Itr) < B; (Itr) += S) #define repeat(...) _overload(__VA_ARGS__, _rep3, _rep2, _rep1)(__VA_ARGS__) #define rep(...) _overload(__VA_ARGS__, _rep3, _rep2, _rep1)(__VA_ARGS__) #include using i64 = long long; using namespace std; using M = ModInt<998244353>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); i64 t; cin >> t; rep(_, t) { i64 n; cin >> n; vector dp(n); vector is_null(n, true); auto dfs = [&](int i, auto &&f) -> M { if (i == n) return 1; if (!is_null[i]) return dp[i]; is_null[i] = false; rep(j, i + 1, n + 1) { dp[i] += 2 * f(j, f); } return dp[i]; }; cout << dfs(0, dfs) << '\n'; } return 0; };