#abc259a. A - Growth Record
A - Growth Record
Score : points
问题描述
Takahashi 在他第 个生日时,身高为 厘米。
另外,我们还知道以下事实:
- 在从 Takahashi 出生(0岁生日)到第 个生日的每一年中,他的身高增长了 厘米。更正式地讲,对于每个 ,他在从第 个生日到第 个生日之间身高增加了 厘米。
- 在 Takahashi 的第 个生日和第 个生日之间,他的身高没有发生变化。
求 Takahashi 在他第 个生日时的身高,以厘米为单位。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Takahashi had his -th birthday, when he was centimeters tall.
Additionally, we know the following facts:
- In each year between Takahashi's birth (-th birthday) and his -th birthday, his height increased by centimeters. More formally, for each , his height increased by centimeters between his -th birthday and his -th birthday.
- Between Takahashi's -th birthday and his -th birthday, his height did not change.
Find Takahashi's height on his -th birthday, in centimeters.
Constraints
- Takahashi was at least centimeter tall at his birth.
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
Sample Input 1
38 20 17 168 3
Sample Output 1
168
In this sample, Takahashi was centimeters tall on his -th birthday. Also, his height did not change between his -th birthday and -th birthday.
From these facts, we find that he was centimeters tall on his -th birthday, so the answer is .
Sample Input 2
1 0 1 3 2
Sample Output 2
1
In this sample, Takahashi was centimeter tall on his -th birthday and centimeters tall on his -st birthday.
Sample Input 3
100 10 100 180 1
Sample Output 3
90
update @ 2024/3/10 10:58:59