Time limit
1s
Memory limit
512 MB
Sua starts at coordinate 0 on the x-axis. There are n candy baskets on the x-axis, and each basket initially contains m candies. The basket positions are x_1, x_2, ..., x_n.
For every 1 unit of time that passes, each basket loses 1 candy. When Sua reaches a basket, she can instantly eat all candies remaining in that basket. Moving distance 1 along the x-axis takes 1 unit of time.
Compute the maximum number of candies Sua can eat.
The first line contains n and m. Each of the next n lines contains one basket position x_i.
Print the maximum number of candies Sua can eat.