Funny Confusion#2982

Funny Confusion

0.1 seconds
64 megabytes
Very easy
S = A_1 + A_2 + \cdots + A_N

Let be an array with elements A_1, \ldots, A_N. The maximum and minimum values of this array are denoted as and , respectively. The sum of all elements in the array is represented by :

Input

The first line contains two integers and , where is the number of elements in the array (2 \le N \le 10000) and is the number of times the Confuse operation has been applied to the original array (1 \le K \le 100).

The second line contains integers, the elements of the array . Each element of is an integer between and .

Output

Output a single integer, the value \max(A) - \min(A).

Examples

Example 1

Loading
Loading