You were gifted a set containing many different integers. As you find large sets too intimidating, you want to make it smaller. In order to achieve this, you are allowed to apply the following operations to it:
The first line contains two integers $$$n$$$, $$$k$$$ ($$$1 \leq k \leq n \leq 2\cdot10^5$$$), the initial size of the set and the size you want to reach. The next line contains $$$n$$$ distinct integers $$$x_i$$$ ($$$1 \leq x_i \leq 10^9$$$), the numbers in the initial set.
Output the minimal number of operations required to reduce the size of the set to $$$k$$$.
5 48 4 6 1 10
2
4 21 8 3 9
3
4 111 4 12 7
8
3 31 5 4
0
For the first sample, we can choose $$$4$$$ from the set and increase it by one. Then the set becomes $$$\{8,5,6,1,10\}$$$. Then we can choose $$$6$$$ and decrease it by one. As 5 is already present in the set, the new set will look like $$$\{8,5,1,10\}$$$ and we are done. It can be shown that no sequence of operations with fewer than $$$2$$$ moves exists, which decreases the size of the set to $$$4$$$.
For the second sample, we can decrease $$$3$$$ two times in a row and increase $$$8$$$ once, ending up with the set $$$\{1,9\}$$$. No shorter move sequence exists.
For the third sample, we can increase $$$4$$$ to $$$7$$$, then decrease $$$12$$$ to $$$11$$$ and then increase $$$7$$$ to $$$11$$$ taking us $$$8$$$ moves in total. This can be proven to be optimal.
| Name |
|---|


