Twin Cities Junior#4568

Twin Cities Junior

1 second
256 megabytes
Medium

On a coordinate line, there are cities. The task is to select distinct pairs of these cities and designate each pair as twin cities. Each city can be paired with at most one other city. Your goal is to determine the maximum and minimum possible total distances between the twin cities.

Input

The first line contains the integers and (1 \leq N \leq 10000, 0 \leq K \leq \lfloor N / 2 \rfloor). The second line contains integers, representing the coordinates of the cities; all coordinates are integers whose absolute values do not exceed 10^9.

Output

Output two numbers on a single line: the maximum and minimum total distances that can be achieved between the twin cities in pairs.

Examples

Example 1

Loading
Loading