#include #include using namespace std; using namespace atcoder; //python3 expander.py main.cpp //export CPLUS_INCLUDE_PATH="/home/yantaro/kyopro/ac-library-master" //https://github.com/yantaro-yanchan/kyopro-library/tree/master/library using ll = long long; using ull = unsigned long long; using ld = long double; using lll = __int128_t; using ulll = __uint128_t; //using mint = modint; //mint::set_mod(M); using mint = modint998244353; //using mint = modint1000000007; template using pq = priority_queue; //大きい順 template using pq_g = priority_queue, greater>; //小さい順 #define vec_unique(v) v.erase(unique(v.begin(), v.end()), v.end()) //重複削除 #define vec_iota(v) iota(v.begin(), v.end(), 0) //0, 1, 2, 3, ..., n - 1にセット #define concat(a, b) a.insert(a.end(), b.begin(), b.end()) #define debug(x) cerr << #x << " = " << x << endl #define maxvalue(array) *max_element(array.begin(), array.end()) #define minvalue(array) *min_element(array.begin(), array.end()) #define sumvalue(array) accumulate(array.begin(), array.end(), 0ll) #define popcount(x) __builtin_popcountll(x) //mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); //uniform_int_distribution dist(1, N); //dist(rng); int dx[4] = {1, -1, 0, 0}; int dy[4] = {0, 0, 1, -1}; //int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1}; //int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1}; #define INF 2e18 #define INF2 2e9 struct Eratosthenes { vector isprime; vector minfactor; void make(int n) { isprime.resize(n + 1, true); minfactor.resize(n + 1, -1); isprime[1] = false; minfactor[1] = 1; for(int p = 2; p <= n; p++) { if(!isprime[p]) continue; minfactor[p] = p; for(int q = p * 2; q <= n; q+=p) { isprime[q] = false; if(minfactor[q] == -1) minfactor[q] = p; } } } vector> factorize(int n) { vector> res; while(n > 1) { int p = minfactor[n]; int exp = 0; while(minfactor[n] == p) { n /= p; exp++; } res.push_back({p, exp}); } return res; } }; const int N = 1e6 + 10; Eratosthenes er; vector cnt(21); void solve() { int k; cin >> k; auto res = er.factorize(k); mint ans = 1; for(auto[p, exp] : res) { ans *= cnt[exp]; } cout << ans.val() << endl; } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); er.make(N); for(int i = 1; i <= 20; i++) { mint res = 0; vector> a(3, vector(3)); auto dfs = [&](auto dfs, int k) -> void { if(k == 4) { a[0][2] = i - (a[0][0] + a[0][1]); a[1][2] = i - (a[1][0] + a[1][1]); a[2][0] = i - (a[0][0] + a[1][0]); a[2][1] = i - (a[0][1] + a[1][1]); if(a[0][2] < 0 || a[1][2] < 0 || a[2][0] < 0 || a[2][1] < 0) return; if(a[0][2] + a[1][2] == a[2][0] + a[2][1]) { a[2][2] = i - (a[0][2] + a[1][2]); if(a[2][2] >= 0) cnt[i]++; } return; } int x = k / 2; int y = k % 2; for(int j = 0; j <= i; j++) { a[x][y] = j; dfs(dfs, k + 1); } }; dfs(dfs, 0); } int t; cin >> t; while(t--) { solve(); } //cout << fixed << setprecision(15) << << endl; return 0; }