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

New Contest

New Contest

Лимит времени 0.5 секунд
Лимит использования памяти 64 MiB

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 S students in the contest. First 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 M students. Though he is excited about the contest, he will enjoy it only if at least 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.

Входные данные

First line contains the number of test cases T (1T100). In the next T lines, you are given 4 separated integers S, N, M and K (1 S1000, 1NS, 1MS, 0KM).

Выходные данные

For each test case, output the required probability with 6 digits after floating point.

Пример

Входные данные #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