PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN
#SP0000206. Chia hai hệ số tổ hợp (Choose and Divide)
HỌC THEO LỘ TRÌNH
1 lộ trìnhBài tập thuộc lộ trình
Mục lục đề ⌄
Đang đọc
Chia hai hệ số tổ hợp (Choose and Divide)
Choose and Divide
Source: UVa
Version: Phuoc Hung OJ Extended
Problem Statement
For nonnegative integers with , the binomial coefficient is
Given four nonnegative integers , calculate
The binomial coefficients may be very large, although the required quotient does not exceed . Print the quotient in decimal notation with exactly five digits after the decimal point.
Input
The only line contains four integers in that order.
Output
Print on one line, rounded to exactly digits after the decimal point.
Subtasks
- Subtask 1 (20 points): ; ; .
- Subtask 2 (30 points): ; ; .
- Subtask 3 (50 points): ; ; .
Examples
Input
10 5 14 9
Output
0.12587
Explanation
and . Hence , which rounds to 0.12587 with five decimal places.