#include using namespace std; int main() { int n,d,k; cin >> n >> d >> k; vector> dp(n + 1, vector(k + d + 10,0)); dp[0][0] = 1;//配るDP for (int i = 1; i < n + 1; i++) { long long sumdp[k + 1] = {0}; for (int j = 0; j <= k; j++) { sumdp[j + 1] = sumdp[j] + dp[i - 1][j]; } for (int j = 0; j <= k; j++) { if(j < d) { dp[i][j] = sumdp[j] - sumdp[0]; } else { dp[i][j] = sumdp[j] - sumdp[j - d]; } } } //for (int i = 0; i < n + 1; i++){for (int j = 0; j < k + d + 10; j++){cout << dp[i][j] << " ";}cout << endl;} cout << dp[n][k] << endl; }