fn main() { const MOD: usize = 998244353; input!{ q: usize, n: [usize; q], } const SZ: usize = 200000; // s_nを事前計算 -> s_n2 let s_n2 = calc_dp(1, 1); // e_nを事前計算 -> e_n^2 let e_n2 = calc_dp(1, 3); for i in 0..q { let ans = (MOD + 5 * s_n2[n[i]] - e_n2[n[i]]) % MOD; println!("{ans}"); } fn calc_dp(s1: usize, s2: usize) -> Vec { let mut dp = vec![0 as usize; SZ+1]; dp[1] = s1; dp[2] = s2; for i in 3..=SZ { dp[i] = dp[i-1] + dp[i-2]; dp[i] %= MOD; } for i in 0..=SZ { dp[i] *= dp[i]; dp[i] %= MOD; } dp } // (5*(s_n^2) - (e_n^2)) % MOD } // ---------- begin input macro ---------- #[macro_export] macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); input_inner!{iter, $($r)*} }; ($($r:tt)*) => { let s = { use std::io::Read; let mut s = String::new(); std::io::stdin().read_to_string(&mut s).unwrap(); s }; let mut iter = s.split_whitespace(); input_inner!{iter, $($r)*} }; } #[macro_export] macro_rules! input_inner { ($iter:expr) => {}; ($iter:expr, ) => {}; ($iter:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($iter, $t); input_inner!{$iter $($r)*} }; } #[macro_export] macro_rules! read_value { ($iter:expr, ( $($t:tt),* )) => { ( $(read_value!($iter, $t)),* ) }; ($iter:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($iter, $t)).collect::>() }; ($iter:expr, chars) => { read_value!($iter, String).chars().collect::>() }; ($iter:expr, bytes) => { read_value!($iter, String).bytes().collect::>() }; ($iter:expr, usize1) => { read_value!($iter, usize) - 1 }; ($iter:expr, $t:ty) => { $iter.next().unwrap().parse::<$t>().expect("Parse error") }; } // ---------- end input macro ---------- #[allow(unused)] use std::{ io::stderr, io::stdin, io::BufRead, io::Write, mem::swap, cmp::min, cmp::max, cmp::Reverse, collections::HashSet, collections::BTreeSet, collections::HashMap, collections::BTreeMap, collections::BinaryHeap, collections::VecDeque, };