Problem A
Mobilization
Mobilization is a brand new strategy game in which you are required to mobilize an army. The army can consist of different types of troops, each of which has a cost, health, and potency. You can acquire any combination of the troop types, even fractional, such that the total cost is no more than the amount you have to spend. The efficacy of the army is equal to its total health value multiplied by its total potency. What is the greatest efficacy you can achieve with the given purchasing constraints?
You may assume that there are always sufficient troops available to buy as many as you want (subject to the total constraint).
Input
The first line will contain two integers, the number of
different types of troops
Following this will be
Output
The output is a line containing one number, the greatest
possible efficacy expressed with a relative or absolute error
less than
Sample Input 1 | Sample Output 1 |
---|---|
4 100000 300 1 0.02 500 0.2 1 250 0.3 0.1 1000 1 0.1 |
19436.05 |
Sample Input 2 | Sample Output 2 |
---|---|
2 100 1 0.1 1 1 1 0.1 |
3025.00 |