Choose and Divide
Time limit1sMemory limit128 MB
For each line, compute the binomial coefficient C(p,q) divided by C(r,s) and print the quotient to five decimal places.
- Level
Medium6 of 10
- Topics
- Math, Number theory, Implementation
- Solved
- No attempts yet
Problem
The binomial coefficient is defined as
Given four natural numbers , , , and , compute the value of divided by .
Input
The input consists of a sequence of lines. Each line contains four non-negative integers , , , and , in this order, separated by single spaces. Every integer is smaller than , and it is guaranteed that and . Read until the end of input.
Output
For each input line, print the value of on its own line, rounded to exactly digits after the decimal point (round half up). You may assume the result is never greater than .