Logo
(追記) (追記ここまで)

22279번 - Quality-Adjusted Life-Year 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 512 MB71566563593.109%

문제

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 0ドル$ and 1ドル$. If someone is living with perfect health, the quality of life is 1ドル$. If someone is dead, then the quality of life is 0ドル$. The quality of life may increase or decrease due to medical treatements, sickness, etc.

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.

입력

The first line of input contains a single integer $N$ (1ドル \leq N \leq 100$), which is the number of periods of constant quality of life during the person's lifetime.

The next $N$ lines describe the periods of life. Each of these lines contains two real numbers $q$ (0ドル < q \leq 1$), which is the quality of life in this period, and $y$ (0ドル < y \leq 100$), which is the number of years in this period. All real numbers will be specified to exactly one decimal place.

출력

Display the QALY accumulated by the person. Your answer will be considered correct if its absolute error does not exceed 10ドル^{-3}$.

제한

예제 입력 1

5
1.0 12.0
0.7 5.2
0.9 10.7
0.5 20.4
0.2 30.0

예제 출력 1

41.470

힌트

출처

ICPC > Regionals > North America > Rocky Mountain Regional > 2018 Rocky Mountain Regional Contest A번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /