题目描述
problem
Given a sequence $ A $ of length $ N $. You can swap the $ i $ th and $ j $ th ($0 \ leq i, j \ leq N-1$) elements of a sequence up to $ M $ times.
Find the maximum value of $\ sum_ {i = 0} ^ {N -1} abs (A_i --i)$ in the sequence created by the operation.
output
Find the maximum value of $\ sum_ {i = 0} ^ {N --1} abs (A_i --i)$ in the sequence created by the operation. Also, output a line feed at the end.
Example
Input
5 2
0 3 2 1 4
Output
12
输入格式
见题面
输出格式
见题面
样例输入
5 2
0 3 2 1 4
样例输出
12