Sister Cities High#4567

Sister Cities High

1 second
256 megabytes
Easy

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

Constraints

and are integers, where 1 \leq N \leq 100000 and 0 \leq K \leq \frac{N}{2}. The coordinates of the cities do not exceed 10^9 in absolute value.

Input

The first line contains the integers and .

The second line contains integers representing the coordinates of the cities.

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