## Find the Highest Profit

There are total N suppliers. Each suppliers has arr[i] products. Every time a product sold the supplier will raise the price by 1. And your profit on any product is equals to the number of products the supplier has left. Your job is to buy K products from N suppliers and make the highest profit.

Input

N, an integer representing the number of suppliers;

arr, a list of long integers representing the supply of the ith supplier;

K, a long integer representing the number of items to be ordered.

Output

Return a long integer representing the highest profit that can be generated.

Constraints

1 <= N <= 100,000

1 <= arr[i] <= 100,000

0 <= i < N

1 <= K <= sum of arr

Example1:

Input:

N = 2

arr = [3, 4]

K = 6

Output:

15

Explanation:

Here supplier one has 3 products. The final prices are [3, 2, 1].

Here supplier two has 4 products. The final prices are [4, 3, 2, 1]

The highest profit is 4 + 2 * 3 + 2 * 2 + 1 = 15

Example2:

Input:

N = 5

arr = [3, 5, 7, 10, 6]

K = 20

Output:

107

Explanation:

(Green = available, Red = left, Blue = empty.)

Here supplier one has 3 products. The final prices are [3, 2, 1].

Here supplier one has 5 products. The final prices are [5, 4, 3, 2, 1]

The highest profit is 10 + 9 + 8 + 2*7 + 3*6 + 4*5+ 4*4 + 4*3 = 107