#include #include using namespace std; typedef long long ll; ll mod = 1e9+7; int main(){ int n, d, k; cin >> n >> d >> k; vector dp(k+1, 0); dp[0] = 1; while(n--){ vector ndp(k+1, 0); for(int i = 0; i < k; i++){ (ndp[i+1] += dp[i]) %= mod; if(i+1+d <= k) (ndp[i+1+d] += (mod-dp[i])) %= mod; } for(int i = 1; i <= k; i++) (ndp[i] += ndp[i-1]+mod) %= mod; dp = ndp; } cout << dp[k] << endl; return 0; }