#include using namespace std; #define rep(i, n) for(int i = 0; i < (int)n; ++i) #define FOR(i, a, b) for(int i = a; i < (int)b; ++i) #define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i) typedef long long ll; typedef long double ld; const ll INF = 1e18; const int Inf = 1e9; const double EPS = 1e-9; const int MOD = 1e9 + 7; int main() { cin.tie(nullptr); ios::sync_with_stdio(0); int n, d, k; cin >> n >> d >> k; vector > dp(n + 1, vector(k + 2)); dp[0][0] = 1; rep (i, n) { rep (j, k) { int l, r; l = j + 1; r = j + d + 1; r = min(r, k + 1); if (l > k) continue; dp[i + 1][l] += dp[i][j]; dp[i + 1][r] -= dp[i][j]; } FOR (j, 1, k + 1) { dp[i + 1][j] += dp[i + 1][j - 1]; if (dp[i + 1][j] < 0) dp[i + 1][j] += MOD; dp[i + 1][j] %= MOD; } } cout << dp[n][k] << endl; return 0; }