#include using namespace std; #define rep(i,N) for(int i=0;i using vec = vector; template using vvec = vector>; template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } const int INF = (ll)1e9; const ll INFLL = (ll)1e18+1; const ll MOD = (ll)1e9+7; const double PI = acos(-1.0); /* const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1}; const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1}; const string dir = "DRUL"; */ struct mint { long long x; mint(long long _x=0):x((_x%MOD+MOD)%MOD){} mint operator-() const { return mint(-x);} mint& operator+=(const mint a) { if ((x += a.x) >= MOD) x -= MOD; return *this; } mint& operator-=(const mint a) { if ((x += MOD-a.x) >= MOD) x -= MOD; return *this; } mint& operator*=(const mint a) { (x *= a.x) %= MOD; return *this; } mint operator+(const mint a) const { mint res(*this); return res+=a; } mint operator-(const mint a) const { mint res(*this); return res-=a; } mint operator*(const mint a) const { mint res(*this); return res*=a; } mint modpow(long long t) const { if (!t) return 1; mint a = modpow(t>>1); a *= a; if (t&1) a *= *this; return a; } // for prime MOD mint inv() const { return modpow(MOD-2); } mint& operator/=(const mint a) { return (*this) *= a.inv(); } mint operator/(const mint a) const { mint res(*this); return res/=a; } friend std::ostream& operator<<(std::ostream& os, const mint& a){ os << a.x; return os; } }; vector dp; int main() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); int N, d, K; cin >> N >> d >> K; dp.assign(N * d + d * 4, 0); dp[0] = 1; rep(k, N){ vector next(N * d + d * 4, 0); rep(i,N * d + 1){ /* rep1(j,d+1){ next[i+j] += dp[i]; }*/ //imosで高速化 next[i+1] += dp[i]; next[i+d+1] -= dp[i]; } rep(i,N*d+d){ next[i+1] += next[i]; } //print(next); swap(dp, next); } cout << dp[K] << endl; }