#include #include //#include using namespace std; using namespace atcoder; 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) { return ((a>b) ? (a = b, true) : (false));} #define rep(i,s,n) for(long long i=s;i<(long long)(n);i++) #define rrep(i,s,n) for(long long i=n-1;i>=s;i--) const long long inf = 1LL<<60; typedef long long ll; #define cmp [](pair a, pair b){return a.second P; typedef pair > PP; #define rll ll,vector,greater #define rP P,vector

,greater

const long double pi = 3.14159265358979; typedef unsigned long long ull; using mint = modint1000000007; int main() { ll n,s,k; cin >> n >> s >> k; ll rest = s - (n-1)*n*k/2; if(rest < 0) { cout << 0 << endl; return 0; } else if(rest == 0) { cout << 1 << endl; return 0; } mint dp[n+1][rest+1]; dp[0][rest] = 1; rep(i,1,n+1) { rep(j,0,rest+1) { for(ll k=j;k>=0;k-=i) { dp[i][k] += dp[i-1][j]; } } } cout << dp[n][0].val() << endl; }