#include using namespace std; using ll = long long; using ull = unsigned long long; const int mod = 1000000007; #include mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count()); int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}; int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1}; template bool chmin(T& a, const T& b){ if (b < a){ a = b; return true; } else { return false; } } template bool chmax(T& a, const T& b){ if (a < b){ a = b; return true; } else { return false; } } void solve(){ int n, s, k; cin >> n >> s >> k; s -= k * n * (n - 1) / 2; if (s < 0){ cout << 0 << '\n'; return; } vector dp(s + 1); dp[0] = 1; for (int i = 1; i <= n; i++){ vector dp2(s + 1); for (int j = 0; j <= s; j++){ if (j >= i){ dp2[j] += dp[j] + dp2[j - i]; } else { dp2[j] += dp[j]; } dp2[j] %= mod; } swap(dp, dp2); } cout << dp[s] << '\n'; } int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int t = 1; while(t--){ cout << fixed << setprecision(15); solve(); } }