Grandpa Quentin's Game#10219

Grandpa Quentin's Game

2 seconds
128 megabytes
Medium

Ryan and Jake are big fans of movies and board games. Since the cinemas are closed, they decide to have some fun with a game they found at Grandpa Quentin's. The game has the following rules:

Ryan wants to maximize his score, while Jake aims to minimize his. They are curious about the difference in their scores when they use completely opposite strategies. Can you help them find this difference?

Input

The first line contains two natural numbers, and .The second line contains integers a_1, a_2, \ldots, a_n, representing the numbers in each cell from the first to the last. 1 \le N, K \le 10^6, -10^9 \le a_i \le 10^9.

Output

Output a single integer: the difference between Ryan's and Jake's scores.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading