Problem X
Studying For Exams

As a seasoned programming contest competitor, you recognize immediately that you can determine the optimal allocation with a computer program. Of course, you have decided to ignore the amount of time you spend solving this problem (i.e. procrastinating).
You have a total of
-
; -
; -
; -
is a non-decreasing function in the interval .
You may allocate any fraction of an hour to a subject, not
just whole hours. What is the maximum average grade you can
obtain over all
Input
The first line of each input contains the integers
Output
Output in a single line the maximum average grade you can
obtain. Answers within
Sample Input 1 | Sample Output 1 |
---|---|
2 96 -0.0080 1.5417 25.0000 -0.0080 1.5417 25.0000 |
80.5696000000 |
Sample Input 2 | Sample Output 2 |
---|---|
3 34 -0.0657 4.4706 23.0000 -0.0562 3.8235 34.0000 -0.0493 3.3529 42.0000 |
70.0731488027 |