Module: Workshop-5: "May the force be with you!"


Problem

5 /6


Strength Gain

Problem

"May the Force be with you" — a famous phrase that even those who are not interested in the Star Wars universe have probably heard. 
The ability of an individual to control the Force directly depends on the level of midi-chlorians in his body.

Let us know the strength of each of the N Jedi: A1,...,AN.
Let's designate the maximum and minimum force values ​​as max(A) and min(A), respectively.
Calculate the total strength of all Jedi SS=A1+A2+…+AN.
Let's replace the power of each Jedi with the difference S and this element: Ai:=S-Ai, \( 1<=i<=N\).
We will call this transformation Increment of force.

Write a program that, given an array B, resulting K–multiply Increment strength to some list of Jedi strengths, calculates the difference max( A)-min(A).

Input 
The first line contains integers N and K, where N — number of array elements B (\(2 <= N <= 10000\)), a K — nbsp;nbsp;number of times Increment Force to initial array A\(1 <= K <= 100\)
The second line contains N array elements B. Array elements B — integers belonging to the range from -2 000 000 000 to 2 000 000 000.

Output 
The only line of the output file must contain an integer - the difference between max(A) and min(A).
 
Example
# Input Output
1 4 2
45 52 47 46
7