#include using namespace std; #define rep(i,n) for(int i=0;i=0;i--) #define Rrep1(i,n) for(int i=n;i>0;i--) #define all(a) a.begin(),a.end() using ll = long long; using ull = unsigned long long; using vi = vector; using vvi = vector; using vvvi = vector; using vl = vector; using vvl = vector; using vvvl = vector; #define INF ((ll)2e15) #define IINF ((int)1e9) 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)); } #define yesno(ans) cout<<((ans)?"Yes\n":"No\n") bool eq(double a, double b) { return abs(a - b) < 0.0000001; } const int di[4] = { 1,0,-1,0 }; const int dj[4] = { 0,-1,0,1 }; /*ACL #include using namespace atcoder; //using mint = modint998244353; using mint=modint1000000007; using vm=vector; using vvm=vector; using vvvm=vector; //*/ int solve() { //分割数 ll N,S,K;cin>>N>>S>>K; vvl dp(N+1,vl(S+1,0)); dp[0][0]=1; //rep1(i,S)dp[0][i]=1; rep1(i,N)rep(j,S+1){ if(j-K*(N-i)>=0) dp[i][j]+=(dp[i-1][j-K*(N-i)])%1000000007; if(j-(N-i)>=0) dp[i][j]+=dp[i][j-(N-i)]%1000000007; dp[i][j]%=1000000007; } cout<sync_with_stdio(0); int T = 1; //cin>>T; while (T--) { solve(); } return 0; }