#include #include #include #include #include #include #include #include #include using namespace std; using ll = long long int; #define REP(i, n) for(int i = 0; i < (int)(n); i++) #define YES(n) std::cout << ((n) ? "YES" : "NO" ) << "\n"; #define Yes(n) std::cout << ((n) ? "Yes" : "No" ) << "\n"; #define ALL_INCLUDED_ENVIRONMENT template class C> std::ostream& operator<<(std::ostream& o, const C& v) { o << "{"; bool init = 1; for (auto e : v) { if (init) { init = 0; } else { o << ", "; } o << e; } o << "}"; return o; } const int SUM_SUP = 20001; const int PARTITION_SUP = 101; const int MOD = 1000000007; vector > partition_number(SUM_SUP, vector(PARTITION_SUP, 0)); void build_partition_number() { for (int k = 0; k < PARTITION_SUP; k++) { partition_number[0][k] = 1; } for (int n = 1; n < SUM_SUP; n++) { for (int k = 1; k <= PARTITION_SUP; k++) { if (k > n) { partition_number[n][k] = partition_number[n][n]; } else { partition_number[n][k] = (partition_number[n][k-1] + partition_number[n-k][k])%MOD; } } } } int main() { // cin.tie(0); // ios::sync_with_stdio(false); ll n, s, k; cin >> n >> s >> k; build_partition_number(); ll rest = s - n*(n-1)*k/2; ll ans; if (rest < 0) ans = 0; else { ans = partition_number[rest][n]; } cout << ans << "\n"; return 0; }