include bits stdc using namespace std define LL long long LL MOD 1e9 i

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include <bits/stdc++.h>
using namespace std;
#define LL long long
LL MOD = 1e9;
int n, k, d, ans = 0;
int dp[110];
class fastio {
public:
fastio() {
ios_base::sync_with_stdio(false);
cout.tie(nullptr);
cin.tie(nullptr);
}
} __fastio;
int f(int x, int t) {
if(x == n) return 1;
if(x > n) return 0;
ans = 0;
for(int i=1; i<=t; i++) {
ans += f(x+i, t);
return dp[x] = ans;
}
}
void solve() {
cin >> n >> k >> d;
memset(dp,-1,sizeof(dp));
cout << f(0,k) - f(0,d-1) << endl;
}
int main() {
__fastio;
solve();
return 0;
}