#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl #define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i) template inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; } template inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; } template ostream& operator << (ostream &s, pair P) { return s << '<' << P.first << ", " << P.second << '>'; } template ostream& operator << (ostream &s, vector P) { for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; } template ostream& operator << (ostream &s, vector > P) { for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; } template ostream& operator << (ostream &s, map P) { EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; } const int MOD = 1000000007; const int MAX_N = 21000; const int MAX_K = 110; int PartNum[MAX_N + 1][MAX_K + 1]; void initPartNum() { for (int n = 0; n <= MAX_N; ++n) for (int k = 0; k <= MAX_K; ++k) PartNum[n][k] = -1; } int calcPartNum(int n, int k) { if (n < 0 || k < 0) return 0; if (PartNum[n][k] != -1) return PartNum[n][k]; if (n == 0 && k == 0) return 1; PartNum[n][k] = 0; if (k > 0) PartNum[n][k] += calcPartNum(n, k-1); if (n >= k) PartNum[n][k] += calcPartNum(n-k, k); if (PartNum[n][k] >= MOD) PartNum[n][k] -= MOD; return PartNum[n][k]; } int N, S, K; int main() { initPartNum(); while (cin >> N >> S >> K) { int n = S - N*(N - 1) / 2 * K; int k = N; cout << calcPartNum(n, k) << endl; } }