You are given an integer array $$$a$$$ of size $$$n$$$.
You have to perform $$$m$$$ queries. Each query has one of two types:
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n, m \le 10^5$$$) — the size of the array $$$a$$$ and the number of queries.
The second line contains $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \le a_i \le 10^5$$$).
Next $$$m$$$ lines contain queries (one per line). Each query has one of two types:
It's guaranteed that there is at least one query of the first type.
For each query of the first type, print the minimum value of $$$dif$$$ that satisfies all required conditions, or $$$-1$$$ if it is impossible to choose $$$k$$$ distinct integers.
12 11 2 1 1 2 1 1 3 2 1 1 3 3 1 2 10 3 1 2 11 3 2 7 2 1 3 9 2 1 1 12 1 1 1 12 4 2 12 4 1 1 12 4 2 1 5 1 3 12 2 1 1 4 3
5 4 1 0 -1 5 0 1
Name |
---|