#D4491. Fractional Knapsack
Fractional Knapsack
Fractional Knapsack
Problem statement
Real variables satisfy the following conditions.
- ()
At this time, find the maximum value that can take. It is known that such a maximum actually exists.
Constraint
input
Input follows the following format. All given numbers are integers.
output
Output the maximum possible value of on one line. The output must not have an error greater than .
Examples
Input
1 1 3 1
Output
0.333333
Input
2 3 3 3 1 2
Output
4.000000
Input
2 1 -1 -3 3 10
Output
3.666667
inputFormat
input
Input follows the following format. All given numbers are integers.
outputFormat
output
Output the maximum possible value of on one line. The output must not have an error greater than .
Examples
Input
1 1 3 1
Output
0.333333
Input
2 3 3 3 1 2
Output
4.000000
Input
2 1 -1 -3 3 10
Output
3.666667
样例
1 1
3 1
0.333333