#include #include #include #include #include #include #define fir first #define sec second #define get(n) scanf("%d",&n); #define gets(s) string s;cin >> (s); #define All(s) (c).begin(), (c).end() #define chmin(x, y) x = min(x, y); #define chmax(x, y) x = max(x, y); #define rep(i, j) for (int (i)=0;(i)<(j);(i)++) #define repk(i, j, k) for(int (i)=(j);(i)<(k);(i)++) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; using namespace std; typedef long long int ll; const ll INF = 10241024; const int MA = 1e9 + 7; int N,S,K; void input(){ cin >> N >> S >> K; } int getcomb(int i, int sum){//when student(i) determine amount, then sum means sum of amount of money of prev stu's if(i == 0 && sum == 0)return 1; if(sum == 0 && i == 1) return K; int a = getcomb(i-1, sum-K*(N-i)) + getcomb(i-1, sum-(N - 1)); return a; } void solve(){ input(); int ans = getcomb(N, S); cout << ans << endl; } int main () { solve(); return 0; }