You are given an array $$$a$$$ of $$$n$$$ non-negative integers, and a positive integer $$$m$$$.
You need to answer $$$q$$$ queries. In each query, you are given a non-negative integer $$$x$$$.
You can do the following operation:
For each query, output the minimum number of operations needed to make the elements of the array equal, or output $$$-1$$$ if they cannot be made equal.
The first line contains a single positive integer $$${1 \le t \le 3 \times 10^5}$$$ — the number of testcases.
The first line of each testcase contains two positive integers $$$n$$$ and $$$m$$$ $$${(1 \le m \le n \le 10^6)}$$$.
The next line contains $$$n$$$ non-negative integers $$${a_1, \space a_2, \space ..a_n}$$$ — the elements of array $$$a$$$, where $$$({0 \le a_i \lt 2^{30}})$$$.
The next line contains a single positive integer $$$q$$$ $$${(1 \le q \le 10^6)}$$$ — the number of queries.
Each of the following $$$q$$$ lines contains a single non-negative integer $$$({0 \le x \lt 2^{30}})$$$.
It is guaranteed that the sum of $$$n$$$ and $$$q$$$ over all testcases does not exceed $$${10^6}$$$.
For each query of each testcase, output the answer to it as described in the problem statement.
22 11 32246 222 4 14 30 28 12426273031
1 -1 3 3 3 3