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 and , compute the country with best life expectancy on , the country with best life expectancy on , and the country with the best life expectancy improvement during the period.
Input begins with two integer numbers and , with . 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.
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: .
Author: Jorge Castro
Generation: 2026-01-25T10:02:20.129Z
© Jutge.org, 2006–2026.
https://jutge.org