#include #include using namespace std; const int MOD = 998244353; int main(){ const int maxSize = 500001; vector inv(maxSize); vector fact(maxSize); vector factInv(maxSize); for(int i=0;i<2;i++) inv[i] = fact[i] = factInv[i] = 1; for(int i=2;i> N; long long res = 0; for(int i=0;i> a; res += a * (i+2) % MOD; res %= MOD; } for(int i=0;i