Submit solution

Points: 1
Time limit: 1.5s
Memory limit: 256M

Author:
Problem type

Karaoke

It's karaoke night, and it's your turn to sing! One problem, you _might_ have overstated your vocal abilities. Luckily, you're a master of music theory, and might be able to save your voice.

The upcoming song has N notes, with pitches P_1, P_2, ... P_N. You can choose not to sing at most M of these notes, without your friends noticing.

Your total "pitchiness" is equal to the difference of the pitches of consecutive notes you choose to sing.

For example, if you sing notes "1 4 5 2 3", your "pitchiness" is equal to:

X = |1-4|+|4-5|+|5-2|+|2-3| = 3 + 1 + 3 + 1 = 8

What is the minimum pitchiness you are able to sing without your friends noticing?

Input

The first line consists of an integer N (1 \leq N \leq 100), the number of notes in the song.

The next line consists of an integer M (1 \leq M \leq 100), the maximum of notes in the song you are allowed to miss.

The last line contains N notes P_i (1 \leq P_i \leq 10^8), representing the pitches of the notes in the song, in order.

Output

Output the minimum "pitchiness" of the song after removing at most M notes.

Example

Input
5
2
10 0 9 0 8
Output
2

Remove the 2nd and 4th notes (both 0). The notes you do sing are "10 9 8", which has a pitchiness of |10-9|+|9-8|.


Comments

There are no comments at the moment.