#include #include using namespace std; using namespace atcoder; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair; using pdd = pair; using pll = pair; using pli = pair; using pil = pair; template using Graph = vector>; const int MOD = 1e9 + 7; const ld PI = acos(-1); int main() { cin.tie(0); ios::sync_with_stdio(false); int N, S, K; cin >> N >> S >> K; int tmp = N * (N - 1) / 2 * K; if (S < tmp) { cout << 0 << endl; return 0; } S -= tmp; vector> dp(N + 1, vector(S + 1)); dp[0][0] = 1; for (int i = 0; i < N; ++i) { for (int j = 0; j <= S; ++j) { int k = N - i; if (j >= k) { (dp[i][j] += dp[i][j - k]) %= MOD; } (dp[i + 1][j] += dp[i][j]) %= MOD; } } cout << dp[N][S] << endl; return 0; }