#include #define REP(i, l, r) for (int i = (l); i <= (r); ++ i) #define DEP(i, r, l) for (int i = (r); i >= (l); -- i) #define fi first #define se second #define pb emplace_back #define mems(x, v) memset((x), (v), sizeof(x)) #define SZ(x) (int)(x).size() #define ALL(x) (x).begin(), (x).end() using namespace std; namespace math { typedef long long LL; template T qpow(T a, LL b) { if (!b) return {1}; T rs = a; b --; for (; b; b >>= 1, a = a * a) if (b & 1) rs = rs * a; return rs; } LL mul(LL a, LL b, LL p) { LL rs = a * b - LL(1.L * a * b / p) * p; rs %= p; if (rs < 0) rs += p; return rs; } template struct mint { unsigned v; static unsigned mod; mint() = default; template mint(T x) { x %= getmod(), v = x < 0 ? x + getmod() : x; } static int getmod() { if (P > 0) return P; else return mod; } static void setmod(unsigned m) { mod = m; } mint operator + () const { return *this; } mint operator - () const { return mint(0) - *this; } mint inv() const { return assert(v), qpow(*this, getmod() - 2); } int val() const { return v; } mint &operator += (const mint &q) { if (v += q.v, v >= getmod()) v -= getmod(); return *this; } mint &operator -= (const mint &q) { if (v -= q.v, v >= getmod()) v += getmod(); return *this; } mint &operator *= (const mint &q) { v = 1ull * v * q.v % getmod(); return *this; } mint &operator /= (const mint &q) { return *this *= q.inv(); } friend mint operator + (mint p, const mint &q) { return p += q; } friend mint operator - (mint p, const mint &q) { return p -= q; } friend mint operator * (mint p, const mint &q) { return p *= q; } friend mint operator / (mint p, const mint &q) { return p /= q; } friend bool operator == (const mint &p, const mint &q) { return p.v == q.v; } friend bool operator != (const mint &p, const mint &q) { return p.v != q.v; } friend bool operator < (const mint &p, const mint &q) { return p.v < q.v; } friend bool operator > (const mint &p, const mint &q) { return p.v > q.v; } friend bool operator <= (const mint &p, const mint &q) { return p.v <= q.v; } friend bool operator >= (const mint &p, const mint &q) { return p.v >= q.v; } friend istream &operator >> (istream &is, mint &a) { is >> a.v; return is; } friend ostream &operator << (ostream &os, const mint &a) { os << a.v; return os; } }; template <> unsigned mint<0>::mod = 998244353; } namespace Milkcat { typedef long long LL; typedef pair pii; const int N = 1e6 + 5, mod = 998244353; typedef math::mint MI; int n; MI rs, fac[N]; int main() { cin >> n, fac[0] = 1; REP(i, 1, n) fac[i] = fac[i - 1] * i; REP(i, 2, n - 2) { int j = n - i; MI x = fac[n] / (fac[i - 2] * fac[j - 2] * i * j * (n - 1)); rs += x * x; } cout << rs << '\n'; return 0; } } int main() { ios::sync_with_stdio(0); cin.tie(0), cout.tie(0); int T = 1; while (T --) Milkcat::main(); return 0; }