#include using namespace std; #if __has_include() #include using namespace atcoder; #endif using ll = long long; using ld = long double; using ull = long long; #define all(s) (s).begin(),(s).end() #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define rever(vec) reverse(vec.begin(), vec.end()) #define sor(vec) sort(vec.begin(), vec.end()) #define fi first #define se second #define P pair #define REP(i, n) for (int i = 0; i < (n); ++i) const ll mod = 998244353; //const ll mod = 1000000007; const ll inf = 2000000000000000000ll; static const long double pi = 3.141592653589793; templatevoid vcin(vector &n){for(int i=0;i>n[i];} templatevoid vcout(vector &n){for(int i=0;i void chmax(T& t,const U& u){if(t void chmin(T& t,const U& u){if(t>u) t=u;} template void ifmin(T t,T u){if(t>u){cout<<-1< void ifmax(T t,T u){if(t>u){cout<<-1<auto make_vector(T x,int arg,Args ...args){if constexpr(sizeof...(args)==0)return vector(arg,x);else return vector(arg,make_vector(x,args...));} ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } void gbjsmzmfuuvdf(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<< fixed << setprecision(20); } using mint = modint998244353; struct S{ mint value; int size; }; using F = mint; S op(S a, S b){ return {a.value+b.value, a.size+b.size}; } S e(){ return {mint(0),1}; } S mapping(F f, S x){ return {x.value+x.size*f, x.size}; } F composition(F f, F g){ return f+g; } F id(){ return mint(0); } mint k[200100]; void com(){ k[0]=1; for(int i=1;i<200100;i++){ k[i]=k[i-1]*i; } } mint g(ll a,ll b){ if(a==1){ return mint(1); } if(b==1){ return mint(1)/mint(2); } if(a==b){ return mint(1)/mint(mint(2).pow(a-1)*k[a-1]); } return mint(1)/mint(mint(2).pow(b))*(mint(2)/mint(k[b-1])-mint(1)/mint(k[b])); } int main() { gbjsmzmfuuvdf(); com(); int n; cin>>n; assert(2<=n&&n<=100000); mint h=mint(4).pow(n-1); for(int i=1;i<=n-1;i++){ h*=i; } vector a(n),b(n); lazy_segtree seg(n); for(int i=0;i>x; assert(0<=x&&x<=2); a[i]=x; } mint ans=0; for(int i=0;i=0;i--){ a.push_back(a[i]); b.push_back(b[i]); } n*=2; rever(b); vector c=convolution(a,b); for(int i=n;i>> F(k+1); vector p; F[0]={{0,mint(1)}}; for(int i=1;i<=n/2;i++){ ll v=i%k; if(v==i){ unordered_map M; for(int j=0;j M; for(int j=0;j> S(int(M.size())); int now=0; for(auto e:M){ if(e.fi>=n/2){ S[now]={e.fi-n,e.se.val()}; } else{ S[now]={e.fi,e.se.val()}; } now++; } sor(S); for(int j=0;j