#include #include using namespace std; #include using namespace atcoder; using ll = long long; using mint = modint998244353; const int MAX = 505050; mint fac[MAX],facinv[MAX]; void init(){ fac[0] = fac[1] = 1; facinv[0] = facinv[1] = 1; for(int i = 2;i a; void solve(){ mint ans = 0; for(int i = 0;i> N; a = vector(N); for(int i = 0;i> a[i]; } solve(); }