F. Minimum Incompatibility
time limit per test
1 second
memory limit per test
512 megabytes
input
standard input
output
standard output

You are given $$$n$$$ integers $$$a_1,a_2,\dots,a_n$$$ and an integer $$$k$$$. You are asked to distribute these $$$n$$$ integers into $$$k$$$ subsets of equal size such that there are no two equal elements in the same subset.

A subset is a group of integers that appear in the array with no particular order. A subset's incompatibility is the difference between the maximum and minimum elements in that array. You need to report the minimum possible sum of incompatibilities of the $$$k$$$ subsets after distributing the numbers optimally, or determine it is impossible.

Input

The input contains only a single case.

The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \leq k\leq n \leq 70$$$, $$$n\bmod k=0$$$), denoting the number of integers and the parameter $$$k$$$.

The second line contains $$$n$$$ integers $$$a_1,a_2,\dots,a_n$$$ ($$$1\le i \le n,\ 1 \leq a_i\leq 10^9$$$), denoting the value of each integer.

Output

Print a single line containing an integer, the minimum possible sum of incompatibilities of the $$$k$$$ subsets after distributing the numbers optimally. If there is no solution, print "-1" instead.

Examples
Input
4 2
1 2 1 4
Output
4
Input
8 4
6 3 8 1 3 1 2 2
Output
6
Input
6 3
5 3 3 6 3 3
Output
-1