#include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; typedef std::pair Pll; typedef std::vector vi; typedef std::vector vl; typedef std::vector vs; typedef std::vector> vpll; typedef std::vector> vvl; template using V = std::vector; template using VV = std::vector>; const long double PI = (acos(-1)); const long long MOD = 1000000007; static const int MAX_INT = std::numeric_limits::max(); // 2147483647 = 2^31-1 static const ll MAX_LL = std::numeric_limits::max(); static const int INF = (1 << 29); // cf) INT_MAX = 2147483647 = 2^31-1 static const ll INFLL = (1ll << 61); // cf) LLONG_MAX = 9223372036854775807 = 2^63 - 1 #define rep(i,n) REP(i,0,n) #define REP(i,x,n) for(ll i=(ll)(x);i<(ll)(n);++i) #define rrep(i,n) RREP(i,0,n) #define RREP(i,x,n) for(ll i=(ll)(n)-1ll;i>=(ll)(x);--i) #define ALL(x) x.begin(), x.end() #define RALL(x) x.rbegin(), x.rend() #define SUM(x) accumulate(ALL(x), 0ll) #define MAX(x) *max_element(ALL(x)) #define MIN(x) *min_element(ALL(x)) // change min/max template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } struct mint { int mod; ll x; // typedef long long ll; mint(ll _x = 0, int _mod = 1000000007) :mod(_mod), x((_x%_mod + _mod) % _mod) {} mint operator-() const { return mint(-x, mod); } mint& operator+=(const mint a) { if ((x += a.x) >= mod) x -= mod; return *this; } mint& operator-=(const mint a) { if ((x += mod - a.x) >= mod) x -= mod; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this; } mint operator+(const mint a) const { return mint(*this) += a; } mint operator-(const mint a) const { return mint(*this) -= a; } mint operator*(const mint a) const { return mint(*this) *= a; } mint pow(ll t) const { if (!t) return mint(1, mod); mint a = pow(t >> 1); a *= a; if (t & 1) a *= *this; return a; } // for prime mod mint inv() const { return pow(mod - 2); } mint& operator=(const mint& rhs) { if (this == &rhs) return *this; x = rhs.x; mod = rhs.mod; return *this; } mint& operator/=(const mint a) { return *this *= a.inv(); } mint operator/(const mint a) const { return mint(*this) /= a; } }; std::istream& operator>>(std::istream& is, mint& a) { return is >> a.x; } std::ostream& operator<<(std::ostream& os, const mint& a) { return os << a.x; } //void Main() { // ll N, S, K; cin >> N >> S >> K; // // vector> dp(N + 10, vector(S + 10, 0)); // // vector> dp(N + 2, vector(S + 2, 0)); // // dp[0][0] = 1; // // REP(i, 1, N + 1) { // rep(j, S + 1) { // ll sum = (i - 1) * i / 2 * K; // if (sum > j) { // dp[i][j] = 0; // } // else if (sum == j) { // dp[i][j] = 1; // } // else{ // dp[i][j] = dp[i-1][j]; // int k = i - 2; // while (k >= 0) { // dp[i][j] -= dp[k][j]; // --k; // } // // if (j - i >= 0) { // dp[i][j] += dp[i][j-i]; // } // } // } // } // // cout << dp[N][S] << endl; //} //void Main() { // ll N, S, K; cin >> N >> S >> K; // // vector> dp(N + 10, vector(S + 10, 0)); // // dp[0][0] = 1; // // REP(i, 1, N + 1) { // rep(j, S + 1) { // if (j - (N - i) >= 0) { // dp[i][j] += dp[i][j - (N - i)]; // } // if (j - K * (N - i) >= 0) { // dp[i][j] += dp[i-1][j - K * (N - i)]; // } // } // } // // cout << dp[N][S] << endl; //} void Main() { ll N, S, K; cin >> N >> S >> K; vector> dp(N + 10, vector(S + 10, 0)); dp[0][0] = 1; S -= (N - 1) * N / 2 * K; if (S < 0) { cout << 0 << endl; return; } REP(i, 1, N + 1) { rep(j, S + 1) { dp[i][j] = dp[i-1][j]; if (j - i >= 0) { dp[i][j] += dp[i][j-i]; } } } cout << dp[N][S] << endl; } int main() { std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout << std::fixed << std::setprecision(15); Main(); double tmp; cin >> tmp; return 0; }