#include #define rep(i,a,b) for(int i=a;i=b;i--) #define fore(i,a) for(auto &i:a) #define all(x) (x).begin(),(x).end() typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60; templatebool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; } templatebool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; } #define pint pair #define pll pair const ll modl=1000000007; using namespace std; vector> dp; int main(void) { ll N=0,S=0,K=0; cin >> N >> S >> K; //1人目が0円の時、全体で // S-=K*(N*(N-1)/2); // if(S<=0){ // cout << 0 << endl; // return 0; // } dp.assign(N+1,vector(S+1,0)); ll num=0; // rep(i,0,S+1) { while(1){ if((N)*(num)<=S){ dp[0][(N)*(num)]=1; num++; } else{ break; } } // dp[0][0]=1; rep(i,0,N-1){ rep(j,0,S+1){ num=0; if(dp[i][j]!=0){ while(1){ if(j+(N-(i+1))*(K+num)<=S){ dp[i+1][j+(N-(i+1))*(K+num)]+=dp[i][j]%modl; dp[i+1][j+(N-(i+1))*(K+num)]%=modl; num++; } else{ break; } } } // if(j!=0){ // dp[i+1][j]+=dp[i+1][j-1]%modl; // dp[i+1][j]%=modl; // } } } if(dp[N-1][S]<0)cout << dp[N-1][S]+modl << endl; else cout << dp[N-1][S] << endl; // cout << endl; // rep(i,0,N+1){ // cout << i << ": " ; // rep(j,0,S+1){ // cout << dp[i][j] << " "; // } // cout << endl; // } return 0; }