#include #include #include const int MOD = 998244353; long long pow(long long x, long long n) { long long res = 1; while (n > 0) { if (n & 1) { res = res * x % MOD; } x = x * x % MOD; n >>= 1; } return res; } std::vector> generate_factor_table(int &N) { std::vector> table(N + 1); for (int i = 2; i < N + 1; i++) { if (table.at(i).empty()) { // i is prime for (int j = i; j < N + 1; j += i) { int x = j; int ct = 0; while (x % i == 0) { x /= i; ct += 1; } table.at(j).emplace(i, ct); } } } return table; } int main() { int N; std::cin >> N; auto table = generate_factor_table(N); std::unordered_map lcm_dict; for (int x = 1; x < N; x++) { int y = N - x; std::unordered_map ct; for (const auto &[k, v]: table.at(x)) { if (ct.find(k) == ct.end()) { ct.emplace(k, v); } else { ct.at(k) += v; } } for (const auto &[k, v]: table.at(y)) { if (ct.find(k) == ct.end()) { ct.emplace(k, v); } else { ct.at(k) += v; } } for (const auto &[k, v]: ct) { if (lcm_dict.find(k) == lcm_dict.end()) { lcm_dict.emplace(k, v); } else { if (lcm_dict.at(k) < v) { lcm_dict.at(k) = v; } } } } long long ans = 1; for (const auto &[k, v]: lcm_dict) { ans *= pow(k, v); ans %= MOD; } std::cout << ans << std::endl; }