#include using namespace std; typedef long long ll; #define REP(i,n) for(ll i=0;i #define chmax(a, b) a = (((a)<(b)) ? (b) : (a)) #define chmin(a, b) a = (((a)>(b)) ? (b) : (a)) constexpr int64_t INF = 1e18; int main() { ll n, s, k, a, mod = 1000000007; cin >> n >> s >> k; a = s - n * (n - 1)* k / 2; if(a < 0) { P(0); return 0; } vector dp(n + 1, VLL(a + 1)); dp[0][0] = 1; REPE(i, 1, n)REPE(j, 0, a){ if(j - i >= 0) dp[i][j] = (dp[i][j - i] + dp[i - 1][j]) % mod; else dp[i][j] = dp[i - 1][j]; } P(dp[n][a]); }