1749 - [usaco2005 open]Landscaping 地形改造

Input

第1行输入整数N和K.之后N行,每行输入一个整数,表示这块地的海拔

Output

如果仅能有K个山顶至少要移走多少土.

Examples

Input

12 1
1
2
3
3
3
2
1
3
2
2
1
2

Output

5
Time Limit 1 second
Memory Limit 128 MB
Discuss Stats
上一题 下一题