{"problem":{"name":"Buildings are Colorful!","description":{"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.   Chokudai is a mayor of the city, and he loves colorful t","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"s8pc_4_b"},"statements":[{"statement_type":"Markdown","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$.\n\n## Input Format\n\n$N$ $K$\n$a_1$ $a_2$ $a_3$ ... $a_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"s8pc_4_b","tags":[],"sample_group":[],"created_at":"2026-03-03 11:01:14"}}