Life expectancy

Good health and well-being is the third target of the United Nations
Suistanable Development Goals (SDGs). One way to assess health in a
population is by looking at mortality data. Life expectancy measures how
many years, on average, a person is expected to live based on current
age death rates.

Given the life expectancy of several countries in two different years y₁
and y₂, compute the country with best life expectancy on y₁, the country
with best life expectancy on y₂, and the country with the best life
expectancy improvement during the period.

Input

Input begins with two integer numbers y₁ and y₂, with 0 ≤ y₁ < y₂ ≤ 10⁴.
Follow data for several countries (at least one): a string with the
country name (all different), and the country life expectancies of the
two years. These are real numbers between 0.00 and 10000.00 with two
digits after the decimal point.

Output

Print three lines with the required information. For the given test
cases, there will always be a clear winner for the three queries.

In the first sample input, Sweden is the best of 1980 with 75.85, Spain
is the best of 2019 with 83.56, and India has the best improvement:
69.66 − 53.81.

Problem information

Author: Jorge Castro

Generation: 2026-01-25T10:02:20.129Z

© Jutge.org, 2006–2026.
https://jutge.org
