Grouping#4599

Grouping

1 second
64 megabytes
Very hard

You are given integers a = \{a_i\}. Let b = \{b_j\} be such numbers (not necessarily integers), that:

such that is minimized.

Find .

Input

First line contains two numbers and . Second line contains exactly integers — \{a_i\}.

Output

Only real number with absolute or relative error not greater than 10^{-8}.

Limits

1 \leq N \leq 5000

1 \leq K \leq N

0 \leq a_i \leq 400000

Examples

Example 1

Loading
Loading