# include # include #include # include #include #include #include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include # include #include #include #include #include //#include using namespace std; using LL = long long; using ULL = unsigned long long; long long MOD = 1000000000 + 7; constexpr long long INF = std::numeric_limits::max(); const double PI = acos(-1); #define fir first #define sec second #define thi third #define debug(x) cerr<<#x<<": "< Pll; typedef pair> Ppll; typedef pair>> Pbll; typedef pair>> Pvll; typedef pair Vec2; struct Tll { LL first, second, third; }; typedef pair Ptll; #define rep(i,rept) for(LL i=0;i=0;i--) LL h, w, n, m, k, t, s, q, last, cnt, sum[2000000], ans, dp[200000][200]; Pll a[2000000],b[2000000]; string str,ss; bool f; char c; int di[4][2] = { { 0,1 },{ 1,0 },{ -1,0 } ,{ 0,-1 } }; struct Edge { LL to, cost; }; vectorvec[1000000]; vectorv; mapma; setst; void YN(bool f) { if (f) cout << "YES" << endl; else cout << "NO" << endl; } void yn(bool f) { if (f) cout << "Yes" << endl; else cout << "No" << endl; } LL partf(LL n, LL k) { if (k == 0 && n == 0)return 1; if (k <= 0 || n < 0)return 0; //dp=-1で初期化 if (dp[n][k] != -1)return dp[n][k]; dp[n][k] = partf(n - s * (k - 1), k - 1) + partf(n - k, k); dp[n][k] %= MOD; return dp[n][k]; } int main() { cin >> n >> m >> s; rep(i,m+1) rep(j, n+1) { dp[i][j] = -1; } cout << partf(m,n) << endl; return 0; }