Problem: You are given a sorted array (for each index condition holds) and an integer .
You are asked to divide this array into non-empty consecutive subarrays. Every element in the array should be included in exactly one subarray.
Let be equal to the maximum in the -th subarray, and be equal to the minimum in the -th subarray. The cost of division is equal to . For example, if and we divide it into subarrays in the following way: , then the cost of division is equal to .
Calculate the minimum cost you can obtain by dividing the array into non-empty consecutive subarrays.
Input Format: The first line contains two integers and ().
The second line contains integers (, ).
Output Format: Print the minimum cost you can obtain by dividing the array into nonempty consecutive subarrays.
Note: In the first test we can divide array in the following way: .