#include #include using namespace std; using ll = long long; #define rep(i, n) for(int i = 0; i < (n); ++i) template bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;} template bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;} const long long INF = 1LL << 60; using Graph = vector>; int gcd(int a, int b){ if(b == 0) return a; else return gcd(b, a%b); } struct Compare { bool operator()(const pair& a, const pair& b) { return a.first > b.first; } }; ll mod = 1e9 + 7; int main(){ ios::sync_with_stdio(false); cin.tie(nullptr); int n,s,k; cin >> n >> s >> k; vector> dp(n+1, vector(s+1, 0)); dp[0][0] = 1; for(int i=0;i<=n;i++){ rep(j,s+1){ if(j - k*(n-i) >= 0 && i > 0) dp[i][j] += dp[i-1][j-k*(n-i)]; dp[i][j] %= mod; if(j - (n-i) >= 0) dp[i][j] += dp[i][j-(n-i)]; dp[i][j] %= mod; } } cout << dp[n-1][s] << endl; return 0; }