#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define __int64 long long #define long __int64 #define REP(i,a,b) for(int i=a;i= 0){ result += ((cnti + 2) / 2) % modd; result %= modd; cnti -= n; } comb2_data[cnt][n] = result; return result; } if(n == 2){ // cout << "COMB2(" << cnt << "," << n << ") = " << (cnt + 2) / 2 << endl; return ((cnt + 2) / 2) % modd; } if(n == 1){ // cout << "COMB2(" << cnt << "," << n << ") = " << 1 << endl; // cout << "!?" << endl; return cnt + 1; }else if(cnt == 0){ // cout << "COMB2(" << cnt << "," << n << ") = " << 1 << endl; // cout << "cnt0" << endl; return 1; }else{ if(comb2_data[cnt][n] != 0){ //cout << "COMB2(" << cnt << "," << n << ") = " << comb2_data[cnt][n] << endl; return comb2_data[cnt][n]; } result = 0; cnti = cnt; while(cnti >= 0){ result += comb2(cnti, n-1); result %= modd; cnti -= n; } // cout << "COMB2(" << cnt << "," << n << ") = " << result << endl; comb2_data[cnt][n] = result; return result; } } int main(){ int n,s,k; int ans = 0; int mind; int test; int cnt; cin >> n >> s >> k; if(k == 0){ mind = 0; }else{ mind = (n - 1) * n / 2 * k; } cnt = s - mind; // cout << mind << endl; // cout << cnt << endl; if(cnt < 0){ cout << 0 << endl; return 0; }else{ ans = 1; cout << comb2(cnt, n) << endl; } return 0; }