#include #include #include #include #include #include #include using namespace std; using ll = long long; constexpr int P = 1000000007; int main() { int n, d, k; cin >> n >> d >> k; int dp[90001] = {}; dp[0] = 1; for (int i = 0; i < n; i++) { for (int j = k; j >= 0; j--) { ll t = 0; for (int h = max(j - d, 0); h < j; h++) { t += dp[h]; } dp[j] = t % P; } } cout << dp[k] << endl; return 0; }