| 2024 ICPC Belarus Regional Contest |
|---|
| Finished |
You are given an array of $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$. Is it possible to turn the array into an arithmetic progression by removing at most $$$k$$$ elements? If it is, then you are also required to minimize the number of element removals.
Recall that a sequence of numbers is called an arithmetic progression if the difference between any two neighboring elements of the sequence is the same, regardless of their choice.
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$2 \le n \le 200\,000$$$, $$$0 \le k \le \min\{\frac{n}{2} - 1, 500\}$$$).
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ ($$$-10^6 \le a_i \le 10^6$$$): the elements of the array.
If it is not possible to turn the array into an arithmetic progression by removing at most $$$k$$$ elements, print $$$-1$$$ on a single line.
Otherwise, in the first line, print an integer $$$m$$$ ($$$0 \le m \le k$$$): the minimum possible number of removed elements. In the second line, print $$$m$$$ distinct integers $$$b_1, b_2, \ldots, b_m$$$ ($$$1 \le b_i \le n$$$): the indices of the removed elements.
If there are multiple optimal solutions, print any of them.
7 22 4 6 7 8 9 10
2 4 6
5 11 2 3 5 6
-1
| Name |
|---|


