#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 calcPartNum() { PartNum[0][0] = 1; for (int n = 0; n <= MAX_N; ++n) { for (int k = 1; k <= MAX_K; ++k) { PartNum[n][k] = PartNum[n][k - 1]; if (n >= k) { PartNum[n][k] += PartNum[n - k][k]; if (PartNum[n][k] >= MOD) PartNum[n][k] -= MOD; } } } } int N, S, K; int main() { calcPartNum(); while (cin >> N >> S >> K) { int n = S - N*(N - 1) / 2 * K; int k = N; if (n < 0 || n < k) cout << 0 << endl; else cout << PartNum[n][k] << endl; } }