/* -*- coding: utf-8 -*- * * 1755.cc: No.1755 Almost Palindrome - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 1000000; const int MAX_M = (MAX_N + 1) / 2; const int MOD = 998244353; /* typedef */ template struct MI { int v; MI(): v() {} MI(int _v): v(_v % MOD) {} MI(long long _v): v(_v % MOD) {} MI operator+(const MI m) const { return MI(v + m.v); } MI operator-(const MI m) const { return MI(v + MOD - m.v); } MI operator*(const MI m) const { return MI((long long)v * m.v); } MI &operator+=(const MI m) { return (*this = *this + m); } MI &operator-=(const MI m) { return (*this = *this - m); } MI &operator*=(const MI m) { return (*this = *this * m); } }; typedef MI mi; /* global variables */ mi es[MAX_M + 1], dp[MAX_N + 1]; /* subroutines */ /* main */ int main() { es[0] = 1; for (int i = 0; i < MAX_M; i++) es[i + 1] = es[i] * 26; dp[0] = dp[1] = 0; dp[2] = 650; for (int i = 3; i <= MAX_N; i++) dp[i] = dp[i - 2] * 26 + mi(650) * (es[i / 2 - 1] * 2 - (! (i & 1) ? 1 : 0)); int tn; scanf("%d", &tn); while (tn--) { int n; scanf("%d", &n); printf("%d\n", dp[n].v); } return 0; }