{"raw_statement":[{"iden":"problem statement","content":"There are $N$ buildings along the line. The $i$\\-th building from the left is colored in color $i$, and its height is currently $a_i$ meters.  \nChokudai is a mayor of the city, and he loves colorful thigs. And now he wants to see at least $K$ buildings from the left.  \n  \nYou can increase height of buildings, but it costs $1$ yens to increase $1$ meters. It means you cannot make building that height is not integer.  \nYou cannot decrease height of buildings.  \nCalculate the minimum cost of satisfying Chokudai's objective.  \nNote: \"Building $i$ can see from the left\" means there are no $j$ exists that (height of building $j$) ≥ (height of building $i$) and $j < i$."},{"iden":"input format","content":"$N$ $K$\n$a_1$ $a_2$ $a_3$ ... $a_N$"},{"iden":"sample input 1","content":"5 5\n3949 3774 3598 3469 3424"},{"iden":"sample input 2","content":"5 3\n7 4 2 6 4"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}