Alice's school is planning to take some students from her class on a field trip. Alice is really excited about it. There are a total of S students in her class. But due to budget constraints, the school is planning to take only N students for the trip. These students will be picked randomly. And each student has equal chance of being picked.
Alice's friend circle has M students including her. Though she is excited about the field trip, she will enjoy it only if there are atleast K of her friends with her on the trip. She is wondering what are the chances of that happening. She needs your help. Tell her the probability that she will enjoy given that she goes on the trip.

-----Input:-----
First line of input contains a single integer T, the number of test cases.

Each test starts with a single line having 4 space separated integers, S, N, M and K.

-----Output:-----
For each test case, output a line containing the required probability. The answer will be accepted if the relative error is not more than 10-6.

-----Constraints:-----
1 ≤ T ≤ 100
1 ≤ S ≤ 1000
1 ≤ N ≤ S
1 ≤ M ≤ S
0 ≤ K < M

-----Example:-----Input:
3
10 10 5 3
10 4 6 4
3 2 2 1

Output:
1.000000
0.000000
0.500000

-----Explanation:-----Case #1:
Every student will be taken to the trip. So all her 4 friends will accompany her to the trip no matter what. 
Case #2:
Alice wants 4 out of her 5 friends to come along with her which isn't possible because the school is willing to pick only 4 students for the trip.

Starter code:

Solutions:
nCr = [[0 for x in range(1001)] for x in range(1001)]
 
for i in range (0,1001):
 nCr[i][0]=1
 nCr[i][i]=1
for i in range (1,1001):
 for j in range (1,1001):
  if i!=j:
   nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1]
 
t=eval(input())
for rajarshisarkar in range(0,t):
 s,n,m,k=list(map(int,input().split(' ')))
 foo=0.000000
 tot = float(nCr[s-1][n-1])
 if s==n:
   print("1.000000\n")
   continue
 if k>n:
   print("0.000000\n")
   continue
 if m>n:
  wola=n
 else:
  wola=m
 for i in range(k,wola):
  foo+= ((nCr[m-1][i])*(nCr[s-m][n-i-1]))
 print("%f\n"% (float(foo/tot)))



nCr = [[0 for x in range(1001)] for x in range(1001)]
 
for i in range (0,1001):
 nCr[i][0]=1
 nCr[i][i]=1
for i in range (1,1001):
 for j in range (1,1001):
  if i!=j:
   nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1]

def main():
 t=int(input())
 for i in range(t):
  num=0
  line = input().split(" ")
  s = int(line[0])
  n = int(line[1])
  m = int(line[2])
  k = int(line[3])
  if k>n-1:
   print("0.000000")
  else:
   j=k
   while j<n and j<m :
    p = int(nCr[m-1][j])
    q = int((nCr[s-m][n-j-1]))
    #print p,q
    num = int(num) + (p*q)
    j=j+1
   den=int(nCr[s-1][n-1])
   ans=float(num)/den
   print('{0:.11f}'.format(ans))
 
def __starting_point():
 main()
__starting_point()

#from __future__ import division


nCr = [[0 for x in range(1001)] for x in range(1001)]
 
for i in range (0,1001):
 nCr[i][0]=1
 nCr[i][i]=1
for i in range (1,1001):
 for j in range (1,1001):
  if i!=j:
   nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1]
'''
def comb(n,r):
    if r>n :
     return 0
    else :
     i = n
     j = 0
     p = 1
     if r>n-r :
      r=n-r
     t=range(1,r+1)
     #print t
     for j in t:
      p=p*i
      p=p/j
      i=i-1
     return p
'''
def main():
 t=int(input())
 #print t
 for i in range(t):
  num=0
  line = input().split(" ")
  #print line
  s = int(line[0])
  n = int(line[1])
  m = int(line[2])
  k = int(line[3])
  #print k
  if k>n-1:
   print("0.000000")
  else:
   j=k
   while j<n and j<m :
    p = int(nCr[m-1][j])
    q = int((nCr[s-m][n-j-1]))
    #print p,q
    num = int(num) + (p*q)
    j=j+1
   den=int(nCr[s-1][n-1])
   #print num,den
   ans=float(num)/den
   print('{0:.10f}'.format(ans))
 # my code here
 
def __starting_point():
 main()
__starting_point()

nCr = [[0 for x in range(1001)] for x in range(1001)]

for i in range (0,1001):
 nCr[i][0]=1
 nCr[i][i]=1
for i in range (1,1001):
 for j in range (1,1001):
  if i!=j:
   nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1]

#print(nCr[4][2])

t=eval(input())
for __ in range(0,t):
 s=input().split()
 s,n,m,k=int(s[0]),int(s[1]),int(s[2]),int(s[3])
 if (s==n):
  print("1.000000")
  continue
 
 foo=float(0.0000000)
 s=s-1
 n=n-1
 m=m-1
 bar=float(nCr[s][n])
 x=k-1
 if(k>n):
  print("0.000000")
  continue
 for i in range(0,x+1):
  foo=foo+(nCr[m][i]*nCr[s-m][n-i])
 
 ans= float(1- (foo/bar))
 print(ans)
 


nCr = [[0 for x in range(1001)] for x in range(1001)]

for i in range (0,1001):
 nCr[i][0]=1
 nCr[i][i]=1
for i in range (1,1001):
 for j in range (1,1001):
  if i!=j:
   nCr[i][j] = nCr[i-1][j] + nCr[i-1][j-1]
t=eval(input())
for _ in range(0,t):
 s,n,m,k=list(map(int,input().split(' ')))
 y=0
 if s==n:
  print("1.000000")
  continue
 if (k>m or k>n):
  print("0.000000")
  continue
 total = float(nCr[s-1][n-1])
 if m>n:z=m
 else:z=n
 for i in range(k,z):
  y+=((nCr[m-1][i])*(nCr[s-m][n-i-1]))
 print("%.6f" % (float(y/total))) 


import sys
def foo(a,b):
 i=a
 c=b
 n=1
 an=1
 if(a-b)<c:
  c=a-b
 while(n<=c):
  an=(an*i)/n
  i-=1
  n+=1
 return an
tc=eval(input())
for i in range(tc):
 a=input().split()
 total=int(a[0])-1
 selection=int(a[1])-1
 friends=int(a[2])-1
 need=int(a[3])
 res=0
 maxi=foo(total,selection)
 if(need>selection): print("0")
 elif(need<(friends-need)):
  for j in range(need):
   if(((selection-j)>=0) and (total-friends)>=(selection-j)):
    res+=(foo(friends,j)*foo(total-friends,selection-j))
  res=(float)(res)/maxi
  print(1.0000000000-res)
 else:
  for j in range(need,friends+1,1):
   if((selection-j)>=0 and (total-friends)>=(selection-j)):
    res+=(foo(friends,j)*foo(total-friends,selection-j))
  res=float(res)/maxi
  print(res)

a = [[0]*1010 for x in range(1010)]
for i in range (1007):
 a[0][i]=0
for i in range (1007):
 a[i][0]=1
for i in range(1,1005):
 for j in range(1,i+1):
  a[i][j]=a[i-1][j-1]+a[i-1][j]
 
test = int(input())
while test>0:
 sum=0.0
 s, n, m, k=list(map(int, input().split()))
 if(s==1):
  print(1.000000)
  test=test-1
  continue
 r=a[s][n]
 for i in range(k,m):
  p=a[m][i+1]
  if((n<i+1) or (s-m)<(n-(i+1))):
   q=0
  else:
   q=a[s-m][n-(i+1)]
  sum=sum+(float(p*q*(i+1)*s))
 sum=sum/(float(r*m*n))
 print("%.6f" % sum)
 test=test-1

def nck(n, k):
 if k>n or k<0:
  return 0
 if k<n-k:
  k = n-k
 ans = 1.0
 for i in range(1, n-k+1):
  ans = ans * (k+i) / i
 return ans

tc=int(input())
while tc:
 s,n,m,k=input().split()
 s,n,m,k=int(s),int(n),int(m),int(k)
 prob=0.0
 i=k
 while i<m:
  prob=prob+nck(m-1,i)/nck(s-1,n-1)*nck(s-m,n-i-1)
  i=i+1
 print("{0:.6f}".format(prob))
 tc=tc-1
  


import sys
def main():
 maxN = 1010
 c = [[0]*maxN for x in range(maxN)]
 for i in range(maxN):
  c[i][0]=1
  c[i][i]=1
 for i in range(1,maxN):
  for j in range(1,maxN):
   if i!=j:
    c[i][j] = c[i-1][j] + c[i-1][j-1]
 t = int(sys.stdin.readline())
 for i in range(t):
  s,n,m,k=list(map(int, sys.stdin.readline().split(' ')))
  D = float (c[s-1][n-1])
  #print D
  N = 0.000000
  if s == n:
   print(1.000000)
   continue
  if k > n:
   print(0.000000)
   continue
  upper = min(m, n)
  for j in range(k, upper):
   N += c[m-1][j] * c[s-m][n-1-j]
  #print N
  ans = float (N/D)
  print("%f" %ans)
main()

def main():
 maxN = 1010
 c = [[0]*maxN for x in range(maxN)]
 for i in range(maxN):
  c[i][0]=1
  c[i][i]=1
 for i in range(1,maxN):
  for j in range(1,maxN):
   if i!=j:
    c[i][j] = c[i-1][j] + c[i-1][j-1]
 t = int(input())
 for i in range(t):
  s,n,m,k=list(map(int,input().split(' ')))
  D = float (c[s-1][n-1])
  #print D
  N = 0.000000
  if s == n:
   print(1.000000)
   continue
  if k > n:
   print(0.000000)
   continue
  upper = min(m, n)
  for j in range(k, upper):
   N += c[m-1][j] * c[s-m][n-1-j]
  #print N
  ans = float (N/D)
  print("%f" %ans)
main()

def nCk(N, K):
 nn=N
 klim = min(K, N-K)+1
 res = 1
 #print " res = " + str(res)
 for kk in range(1, klim):
  res *= nn
  #print " res = " + str(res)
  res /= kk
  #print " res = " + str(res)
  nn -= 1
 #print str(N) + " choose " + str(K) + " = " + str(res)
 return res


def doTest():
 CC = input()
 CCT = CC.split()
 S = int(CCT[0])
 N = int(CCT[1])
 M = int(CCT[2])
 K = int(CCT[3])
 #print "S=" + str(S) + " N = " + str(N) + " M = "  + str(M) + " K = " + str(K       )
 den = nCk(S-1, N-1)
 #print "den = " + str(den)
 klim = min(M, N)
 num = 0
 for kk in range(K, klim):
  if ((S-M) < (N-kk-1)):
   continue
  num += nCk(M-1, kk)*nCk(S-M, N-kk-1)

 #print "num = " + str(num)
 ans = num/float(den)
 print("%.9f" % ans)


# MAIN
T = int(input())
#print "T = " + str(T)
for tt in range(0, T):
 doTest()



import math
f=[1]
for i in range(1,1002):
 f.append(i*f[i-1])
def c(n,r):
 if n<r:
  return 0
 else:
  return float(f[n]/(f[n-r]*f[r]))
t=int(input())
while t>0:
 [s,n,m,k]=[int(i) for i in input().split()]
 ways=0.0
 if k==0 or s==n:
  print(float(1))
 elif k>=n:
  print(float(0))
 else:
  if n-k<m-k:
   j=k-1
   flag=0
   while s-m>=0 and j>=0 and n-j-1>=0:
    ways=ways+c(m-1,j)*c(s-m,n-j-1)
    j-=1
  else:    
   j=k
   flag=1
   while s-m>=0 and j<m and n-j-1>=0:
    ways=ways+c(m-1,j)*c(s-m,n-j-1)
    j+=1
  p=ways/c(s-1,n-1)
  if flag==0:
   p=1-p
  print(p)
 t-=1


import math
f=[1]
for i in range(1,1002):
 f.append(i*f[i-1])
def c(n,r):
 if n<r:
  return 0
 else:
  return float(f[n]/(f[n-r]*f[r]))
t=int(input())
while t>0:
 [s,n,m,k]=[int(i) for i in input().split()]
 ways=0.0
 if k==0 or s==n:
  print(float(1))
 elif k>=n:
  print(float(0))
 else:
  j=k-1
  flag=0
  while s-m>=0 and j>=0 and n-j-1>=0:
   ways=ways+c(m-1,j)*c(s-m,n-j-1)
   j-=1
  p=ways/c(s-1,n-1)
  p=(1-p)
  print(p)
 t-=1