#BS0000408. Pha nước đường 2 (Sugar Water 2)
Bài tập thuộc lộ trình
Mục lục đề ⌄
Pha nước đường 2 (Sugar Water 2)
Sugar Water 2
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
Takahashi has sugar solutions, with grams of sugar and grams of water in solution . Aoki has solutions, with grams of sugar and grams of water in solution . A mixture combines the entire contents of one solution from each person. Its sugar concentration in percent is . Ignore saturation. Count all index pairs separately, even if concentrations coincide. Find the -th largest concentration.
Input
Line 1 contains integers . The next lines contain . The final lines contain .
Output
Print the required concentration in percent. Absolute or relative error must not exceed .
Subtasks
- Subtask 1 (20 points): ; ; for ; for .
- Subtask 2 (30 points): ; ; for ; for .
- Subtask 3 (50 points): ; ; for ; for .
Examples
Input
3 1 1
1 2
4 1
1 4
1 4
Output
50
Explanation
The three mixtures have concentrations , , respectively, obtained from sugar/total masses , , . In descending order they are ; rank 1 is 50.