#include #include "atcoder/all" #define debug cout << "OK" << endl; template inline bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; } inline int Code(char c) { if ('A' <= c and c <= 'Z')return (int)(c - 'A'); if ('a' <= c and c <= 'z')return (int)(c - 'a'); if ('0' <= c and c <= '9')return (int)(c - '0'); assert(false); } using namespace std; using namespace atcoder; #define int long long constexpr int MOD = 998244353; constexpr int INF = (1LL << 63); using minit = modint1000000007; using minit2 = modint998244353; template ostream& operator << (ostream& st, const vector& v) { for (const T value : v) { st << value << " "; } return st; } template istream& operator >> (istream& st, vector& v) { for (T& value : v) { st >> value; } return st; } int pow_(const int a, const int b, const int m = INF) { int res = 1; int base = a; for (int i = 0; i < 64; i++) { if (b & (1ll << i))res *= base; res %= m; base = base * base; base %= m; } return res; } template void to_sum(vector& arr) { int n = (int)arr.size(); for (int i = 0; i < n - 1; i++) { arr[i + 1] += arr[i]; } return; } // // class Solver { public: int T; Solver() :T(1) {} ~Solver(){} void multi(); void solve() const; void sp(int x)const; }; void Solver::multi() { cin >> T; return; } void Solver::sp(const int x)const { cout << fixed << setprecision(x) << endl; return; } void Solver::solve() const { int N, D, K; cin >> N >> D >> K; vector> DP(N + 1, vector(K + D + 3, 0)); DP[0][0] = 1; for (int i = 0; i < N; i++) { for (int k = 0; k < K; k++) { DP[i + 1][k + 1] += DP[i][k]; DP[i + 1][k + D + 1] -= DP[i][k]; } to_sum(DP[i + 1]); } cout << DP[N][K].val() << endl; } signed main() { Solver solver; //solver.multi(); //solver.sp(); for (int i = 0; i < solver.T; i++) solver.solve(); return 0; } /* * わらびのコードこーどすぺーす (σ・∀・)σゲッツ!! */