eolymp
bolt
Спробуйте наш новий інтерфейс для відправки розв'язків
Задачі

New Contest

New Contest

\includegraphics{https://static.e-olymp.com/content/aa/aa367df09f88f37afae625384f00d9e36c94de03.jpg} Now, I made a contest for our coach’s - Etibar’s anniversary. I and he are really excited about it. There will be a total of \textbf{S} students in the contest. First \textbf{N} students in the final standings will be awarded. He has a list (favorite students list) what cantains the best students in informatics Olympiad. His favorite students list contains \textbf{M} students. Though he is excited about the contest, he will enjoy it only if at least \textbf{K }of students from his favorite students list are awarded. He is wondering what are the chances of that happening. He needs your help. Tell him the probability that he will enjoy. It is known that each student has equal chance of being awarded. \InputFile First line contains the number of test cases \textbf{T} (\textbf{1} ≤ \textbf{T} ≤ \textbf{100}). In the next \textbf{T} lines, you are given \textbf{4} separated integers \textbf{S}, \textbf{N}, \textbf{M} and \textbf{K }(\textbf{1 }≤ \textbf{S} ≤ \textbf{1000}, \textbf{1} ≤ \textbf{N} ≤ \textbf{S}, \textbf{1} ≤ \textbf{M} ≤ \textbf{S}, \textbf{0} ≤ \textbf{K} ≤ \textbf{M}). \OutputFile For each test case, output the required probability with \textbf{6} digits after floating point.
Ліміт часу 0.5 секунд
Ліміт використання пам'яті 64 MiB
Вхідні дані #1
3
10 10 5 3
10 4 6 4
3 2 2 1
Вихідні дані #1
1.000000
0.071429
1.000000
Автор Mahammad Valiyev
Джерело Local Contest #2 Qafqaz University by Mahammad Valiyev