#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #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 ALL(c) (c).begin(), (c).end() #define SIZE(v) ((int)v.size()) template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } #define pb push_back #define mp make_pair #define mt make_tuple ll MOD = 1e9 + 7; int main(void) { cin.sync_with_stdio(false); ll N, D, K; cin >> N >> D >> K; // [行動回数][何段目か] vector> dp(N + 1, vector(K + 1)); dp[0][0] = 1; REP(n, N) { REP(k, K) { FOR(d, 1, D + 1) { if (k + d <= K) { dp[n + 1][k + d] += dp[n][k]; dp[n + 1][k + d] %= MOD; } } } } // for(auto e: dp[N]) cout << e << " "; // cout << endl; cout << dp[N][K] << endl; return 0; }