NC223863. ForgedintheBarrens
描述
输入描述
The first line contains an integer![]()
, denoting the number of beacon towers throughout the Barrens.
The second line containsintegers
![]()
is the altitudes of the beacon towers in order.
输出描述
Outputlines, the
th of which contains an integer indicating the maximum sum for
.
示例1
输入:
5 1 2 3 4 5
输出:
4 3 2 1 0
示例2
输入:
5 1 2 1 2 1
输出:
1 2 2 1 0