Problem D
Quality-Adjusted Life-Year
Languages
en
ja

The Quality-Adjusted Life-Year (QALY) is a way to measure a person’s quality of life that includes both the quality and the quantity of life lived.
The quality of life lived can be quantified as a number
between
The QALY for each period in which the quality of life is constant is simply the product of the quality of life and the length of the period (in years). We wish to know the amount of QALY accumulated by a person at the time of death, given the complete history of this person.
Input
The first line of input contains a single integer
The next
Output
Display the QALY accumulated by the person. Your answer will
be considered correct if its absolute error does not exceed
Sample Input 1 | Sample Output 1 |
---|---|
5 1.0 12.0 0.7 5.2 0.9 10.7 0.5 20.4 0.2 30.0 |
41.470 |