#include using namespace std; #include using namespace atcoder; #define rep(i,n) for(int i=0;i<(int)n;i++) #define rep1(i,n) for(int i=1;i<=(int)n;i++) using ll = long long; using ull = unsigned long long; using P = pair; using Pl = pair; using vi = vector; using vvi = vector; using vd = vector; using vs = vector; using vb = vector; using vvb = vector; using vl = vector; using vvl = vector; #define inf 2147483642//int max #define linf 900000000000000000 const double PI = 3.1415926535897932384626433832795028841971; templateinline bool chmax(T& a, T b) { return ((a < b) ? (a = b, true) : (false)); } templateinline bool chmin(T& a, T b) { return ((a > b) ? (a = b, true) : (false)); } long long llceil(long long a, long long b) { if (a % b == 0) { return a / b; }return (a / b) + 1; } #define yes cout<<"Yes"<> split_dp(k + 1, vl(n + 1)); split_dp[0][0] = 1; for (long long i = 1; i <= k; i++) { for (long long j = 0; j <= n; j++) { if (j-i >= 0) { split_dp[i][j] = (split_dp[i - 1][j] + split_dp[i][j - i]) % M; } else { split_dp[i][j] = (split_dp[i - 1][j]); } } } return split_dp[k][n]; } int main() { //分割DP ll n, s, k; cin >> n >> s >> k; ll zub = s - n*(n - 1)/2 * k;//最低何円 //これをn分割 ll M = 1e9 + 7; if (zub <0) { cout << 0 << endl; return 0; } ll ans = split_num(n, zub, M); cout << ans << endl; return 0; }