"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
S
,
S=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 00
0 to 2 000 000 000
.