// -fsanitize=undefined, //#define _GLIBCXX_DEBUG #pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "testlib.h" using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i=0;i-1;i--) #define pb push_back #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << " )\n"; template using vec = vector; template using vvec = vec>; template using vvvec = vec>; using ll = long long; using pii = pair; using pll = pair; template bool chmin(T &a, T b){ if (a>b){ a = b; return true; } return false; } template bool chmax(T &a, T b){ if (a T sum(vec x){ T res=0; for (auto e:x){ res += e; } return res; } template void printv(vec x){ for (auto e:x){ cout< ostream& operator<<(ostream& os, const pair& A){ os << "(" << A.first <<", " << A.second << ")"; return os; } ostream& operator<<(ostream& os, const mint& a){ os << a.val(); return os; } template ostream& operator<<(ostream& os, const set& S){ os << "set{"; for (auto a:S){ os << a; auto it = S.find(a); it++; if (it!=S.end()){ os << ", "; } } os << "}"; return os; } template ostream& operator<<(ostream& os, const vec& A){ os << "["; rep(i,A.size()){ os << A[i]; if (i!=A.size()-1){ os << ", "; } } os << "]" ; return os; } const int M = 10000; mint fact[M],finv[M],inverse[M]; void init_mint(){ fact[0] = 1, fact[1] = 1; finv[0] = 1, finv[1] = 1; inverse[0] = 0, inverse[1] = 1; for (int n=2;n cnt(1< f(n+1,0); f[k] = 1; for (int i=k+1;i<=n;i++){ f[i] = 1; for (int j=k;j g(m+1,n+1); rep(S,1<