atcoder#ABC294F. [ABC294F] Sugar Water 2
[ABC294F] Sugar Water 2
Score : points
Problem Statement
Takahashi and Aoki have and bottles of sugar water, respectively. Takahashi's -th sugar water is composed of grams of sugar and grams of water. Aoki's -th sugar water is composed of grams of sugar and grams of water. There are ways to choose one from Takahashi's sugar waters and one from Aoki's and mix them. Among the sugar waters that can be obtained in this way, find the concentration of sugar in the sugar water with the -th highest concentration of sugar. Here, the concentration of sugar in sugar water composed of grams of sugar and grams of water is percent. We will ignore saturation.
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the concentration of sugar in the sugar water with the -th highest concentration of sugar in percent. Your output will be considered correct if the absolute or relative error from the true value is at most .
3 1 1
1 2
4 1
1 4
1 4
50.000000000000000
Let denote the sugar water obtained by mixing Takahashi's -th sugar water and Aoki's -th. Below are the sugar waters that can be obtained and their concentrations of sugar.
- :
- :
- :
Among them, the sugar water with the highest concentration of sugar is , with a concentration of percent.
2 2 2
6 4
10 1
5 8
9 6
62.500000000000000
4 5 10
5 4
1 6
7 4
9 8
2 2
5 6
6 7
5 3
8 1
54.166666666666664