# Arup Guha
# 4/27/2025
# Solution to COP 4516 Final Team Contest Problem: Returning Papers

# My "constants"
MAX = 310
MOD = 1000000007

# Build Pascal's Triangle.
c = [[1],[1,1]]
for i in range(2,MAX):

    # Build row here.
    tmp = []

    # Go through each item.
    for j in range(i+1):
        if j == 0 or j == i:
            tmp.append(1)
        else:
            tmp.append( (c[-1][j-1]+c[-1][j])%MOD )

    # Add this row.
    c.append(tmp)
    
# Process cases.
nC = int(input())
for loop in range(nC):

    toks = input().split()
    n = int(toks[0])
    att = int(toks[1])
    nPap = int(toks[2])
    nGet = int(toks[3])

    # Answer is C(a,s)*C(n-a,p-s)/C(n,p).
    '''
    Basically, the sample space is each set of papers I could have
    so choose p students out of n.
    The number of ways to get a success is the number of ways we
    can choose nGet students out of att students there, times
    The number of ways to choose nPap-nGet students out of the
    n-att students not in class.
    '''

    # Compute numerator and denominator under mod.
    num = (c[att][nGet]*c[n-att][nPap-nGet])%MOD
    den = c[n][nPap]

    # Cheating a bit since MOD is prime...utilizing Euler.
    # Note: Due to ths structure of den, it won't be 0...
    res = (num*pow(den, MOD-2, MOD))%MOD
    print(res)
    
