#include #include #include using namespace std; int r, x, n, b; long long dp[55][55][15]; const long long MOD = 1e9 + 7; long long rec(int r1, int x1, int b1){ if(b1==1){ if(r1*x1>=b){ return 1; } return 0; } if(dp[x1][r1][b1]!=-1){ return dp[x1][r1][b1]; } long long result=0; for(int i=1; i=b){ result+=rec(r1-i, x1, b1-1)*2; result %= MOD; } } for(int j=1; j=b){ result+=rec(r1, x1-j, b1-1)*2; result %= MOD; } } return dp[x1][r1][b1]=result; } int main() { // ifstream cin("input.txt"); int t=0; cin>>t; for(int i=0; i>r>>x>>b>>n; memset(dp, -1, sizeof dp); cout<