/* -*- coding: utf-8 -*- * * 1885.cc: No.1885 Flat Permutation - yukicoder */ #include #include using namespace std; /* constant */ const int MAX_N = 200000; const int MOD = 998244353; /* typedef */ /* typedef */ template struct MI { int v; MI(): v() {} MI(int _v): v(_v % MOD) {} MI(long long _v): v(_v % MOD) {} MI operator+(const MI m) const { return MI(v + m.v); } MI operator-(const MI m) const { return MI(v + MOD - m.v); } MI operator*(const MI m) const { return MI((long long)v * m.v); } MI &operator+=(const MI m) { return (*this = *this + m); } MI &operator-=(const MI m) { return (*this = *this - m); } MI &operator*=(const MI m) { return (*this = *this * m); } }; typedef MI mi; /* global variables */ mi dp[MAX_N]; /* subroutines */ /* subroutines */ /* main */ int main() { int n, x, y; scanf("%d%d%d", &n, &x, &y); if (x > y) swap(x, y); if (x > 1) x++; if (y < n) y--; int d = y - x; //printf("d=%d\n", d); if (d < 0) { puts("0"); return 0; } dp[0] = 1; for (int i = 0; i < d; i++) { dp[i + 1] += dp[i]; if (i + 3 <= d) dp[i + 3] += dp[i]; } printf("%d\n", dp[d].v); return 0; }