#line 1 "Main.cpp" #include #include #include #include #include #line 2 "nachia\\math\\combination.hpp" #line 4 "nachia\\math\\combination.hpp" namespace nachia{ template class Comb{ private: ::std::vector F; ::std::vector iF; public: Comb(int n){ F.assign(n+1, Modint(1)); for(int i=1; i<=n; i++) F[i] = F[i-1] * Modint(i); iF.assign(n+1, Modint(1)); iF[n] = F[n].inv(); for(int i=n; i>=1; i--) iF[i-1] = iF[i] * Modint(i); } Modint factorial(int n) const { return F[n]; } Modint inv_factorial(int n) const { return iF[n]; } Modint inv_of(int n) const { return iF[n] * F[n-1]; } Modint comb(int n, int r) const { if(n < 0 || n < r || r < 0) return Modint(0); return F[n] * iF[r] * iF[n-r]; } Modint inv_comb(int n, int r) const { if(n < 0 || n < r || r < 0) return Modint(0); return iF[n] * F[r] * F[n-r]; } Modint perm(int n, int r) const { if(n < 0 || n < r || r < 0) return Modint(0); return F[n] * iF[n-r]; } Modint inv_perm(int n, int r) const { if(n < 0 || n < r || r < 0) return Modint(0); return iF[n] * F[n-r]; } Modint operator()(int n, int r) const { return comb(n,r); } }; } // namespace nachia #line 8 "Main.cpp" //#include "nachia/fps/formal-power-series-struct.hpp" using namespace std; using i32 = int32_t; using u32 = uint32_t; using i64 = int64_t; using u64 = uint64_t; #define rep(i,n) for(int i=0; i<(int)(n); i++) const i64 INF = 1001001001001001001; //using FPS = nachia::FormalPowerSeriesNTT<998244353>; using modint = atcoder::static_modint<998244353>; //using modint = FPS::Elem; auto comb = nachia::Comb(300000); modint solve(int N, int B, int W){ //cout << "solve(" << N << ", " << B << ", " << W << ")" << endl; N -= B; B++; //cout << "N = " << N << " , B = " << B << " , W = " << W << endl; modint ans = 0; for(int a=0; a<=B; a++){ int b = W - (N-2*(B-a)); int c = B - a - b; if(b < 0 || c < 0 || b + 2*c + W != N) continue; //cout << " a = " << a << " , b = " << b << " , c = " << c << endl; if(c != 0) ans += comb(B, a) * comb(B-a, b) * comb(W+c-1, c-1); else if(W == 0) ans += comb(B, a) * comb(B-a, b); } //cout << "ans = " << ans.val() << '\n'; return ans; } int main(){ int N, B, W; cin >> N >> B >> W; if(B == 1){ if(W == N - 2){ cout << 2 << '\n'; } else if(W == N - 3){ cout << (N-2) << '\n'; } else{ cout << 0 << '\n'; } } else{ modint ans = solve(N+2, B, W) - solve(N+1, B-1, W) * 2 + solve(N, B-2, W); cout << ans.val() << '\n'; } return 0; } struct ios_do_not_sync{ ios_do_not_sync(){ std::ios::sync_with_stdio(false); std::cin.tie(nullptr); } } ios_do_not_sync_instance;