#include using namespace std; #if __has_include() #include using namespace atcoder; #endif using ll = long long; using ld = long double; using ull = long long; #define all(s) (s).begin(),(s).end() #define rep2(i, m, n) for (int i = (m); i < (n); ++i) #define rep(i, n) rep2(i, 0, n) #define drep2(i, m, n) for (int i = (m)-1; i >= (n); --i) #define drep(i, n) drep2(i, n, 0) #define rever(vec) reverse(vec.begin(), vec.end()) #define sor(vec) sort(vec.begin(), vec.end()) #define fi first #define se second #define P pair //const ll mod = 998244353; const ll mod = 1000000007; const ll inf = 2000000000000000000ll; static const long double pi = 3.141592653589793; templatevoid vcin(vector &n){for(int i=0;i>n[i];} templatevoid vcout(vector &n){for(int i=0;i void chmax(T& t,const U& u){if(t void chmin(T& t,const U& u){if(t>u) t=u;} template void ifmin(T t,T u){if(t>u){cout<<-1< void ifmax(T t,T u){if(t>u){cout<<-1<auto make_vector(T x,int arg,Args ...args){if constexpr(sizeof...(args)==0)return vector(arg,x);else return vector(arg,make_vector(x,args...));} ll modPow(ll a, ll n, ll mod) { ll ret = 1; ll p = a % mod; while (n) { if (n & 1) ret = ret * p % mod; p = p * p % mod; n >>= 1; } return ret; } void gbjsmzmfuuvdf(){ ios::sync_with_stdio(false); std::cin.tie(nullptr); cout<< fixed << setprecision(20); } constexpr ll MAX = 300000; ll fac[MAX],finv[MAX],inv[MAX]; void COMinit(){ fac[0]=fac[1]=1; finv[0]=finv[1]=1; inv[1]=1; for(int i=2;i=n-1&&n-1>=0){ return COM(n+k-1,n-1); } else{ return 0; } } using mint = modint1000000007; int main() { gbjsmzmfuuvdf(); COMinit(); ll n,a,b,l; cin>>n>>a>>b>>l; vector> dp(50,vector(20010)); dp[0][0]=1; for(int i=0;i>s; for(int j=i;j>=0;j--){ mint tmp=0; for(int k=0;k<20005;k++){ tmp+=dp[j][k]; if(k>=s) tmp-=dp[j][k-s]; dp[j+1][k+1]+=tmp; } } } mint ans=0; for(int i=0;i<=b;i++){ for(int j=0;j<=a;j++){ ll x=a-j,y=i; if(x<0) continue; if((x+y)%l!=0) continue; if((x+y)/l>45) continue; ans+=dp[(x+y)/l][y]*COM(n+j-1,j); // cout<