//coder:luckYrat(twitter:@luckYrat_) //dijkstraから逃げるな //おすすめの曲 無機質世界に彩を-MisomyL //https://www.youtube.com/watch?v=8G590EiLQ3E //標準入出力 #include #include #include #include //コンテナ系 #include #include #include #include #include #include #include //複素数 #include #include #include #include #include //なまえくーかん! using namespace std; using ll = long long; using P = pair; //てーすう! const int mod = 998244353; const int inf = (1<<30)-1; const ll linf = (1LL<<62LL)-1; const double EPS = (1e-10); //でふぁいん! #define anyfill(n,s) setw(n) << setfill(s) #define loop(s) for(int i = 0; s > i; i++) #define rep(i,q) for(int i = 0; (q) > i; i++) #define repp(i,n,q) for(int i = n; (q) > i; i++) #define dep(i,q) for(int i = (q); 0 < i; i--) //みじかく! #define pb push_back #define mkp make_pair #define fir first #define scn second #define ednl endl //いぇすのー! #define YesNo(a) (a?"Yes":"No") #define YESNO(a) (a?"YES":"NO") #define yesno(a) (a?"yes":"no") //きんぼーnほーこー!! P ar4[4] = {mkp(0,1),mkp(0,-1),mkp(1,0),mkp(-1,0)}; P ar8[8] = {mkp(-1,-1),mkp(-1,0),mkp(-1,1),mkp(0,-1),mkp(0,1),mkp(1,-1),mkp(1,0),mkp(1,1)}; P x[3] = {{1,2},{2,3},{3,5}}; /* 確認ポイント cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる 計算量は変わらないが楽できるシリーズ min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる */ template struct ModInt{ int n; ModInt():n(0){} ModInt(int n_):n(n_ >= 0 ? n_%mod : mod - ((-n_)%mod) ){} ModInt &operator+=(const ModInt &p){ if((n+=p.n) >= mod)n-=mod; return *this; } ModInt &operator-=(const ModInt &p){ n+=mod-p.n; if(n >= mod)n-=mod; return *this; } ModInt &operator*=(const ModInt &p){ n = (int) ((1LL*n*p.n)%mod); return *this; } ModInt &operator/=(const ModInt &p){ *this *= p.inverse(); return *this; } ModInt operator-() const {return ModInt(-n);} ModInt operator+(const ModInt &p) const {return ModInt(*this) += p;} ModInt operator-(const ModInt &p) const {return ModInt(*this) -= p;} ModInt operator*(const ModInt &p) const {return ModInt(*this) *= p;} ModInt operator/(const ModInt &p) const {return ModInt(*this) /= p;} bool operator==(const ModInt &p) const {return n==p.n;} bool operator<(const ModInt &p) const {return n(const ModInt &p) const {return n>p.n;} bool operator>=(const ModInt &p) const {return n>=p.n;} bool operator<=(const ModInt &p) const {return n<=p.n;} bool operator!=(const ModInt &p) const {return n!=p.n;} ModInt inverse() const { int a = n,b = mod,u = 1,v = 0; while(b){ int t = a/b; a -= t*b; swap(a,b); u -= t*v; swap(u,v); } return ModInt(u); } ModInt pow(int64_t z) const { ModInt ret(1),mul(n); while(z > 0){ if(z & 1) ret *= mul; mul *= mul; z >>= 1; } return ret; } friend ostream &operator<<(ostream &os, const ModInt &p){ return os << p.n; } friend istream &operator>>(istream &is, ModInt &a){ int64_t t; is >> t; a = ModInt (t); return (is); } }; using mint = ModInt; __attribute__((constructor)) void initial() { cin.tie(0); ios::sync_with_stdio(false); } long long dp[110][2];//n番目 切るor切らない int main(){ int t;cin>>t; //反転回転含めない かつ 縦4nマス 横4nマスって誤読して永遠に解けなかったが??????????? for(int i = 0; t > i; i++){ int n;cin>>n; dp[0][1] = 2; for(int i = 1; n >= i; i++){ dp[i][0] = (dp[i-1][0]*2+dp[i-1][1])%mod; dp[i][1] = (dp[i-1][0]*2+dp[i-1][1])%mod; } cout << dp[n][0] << endl; } }