| TheForces Round #35 (LOL-Forces) |
|---|
| Finished |
In a class, a test has happened and $$$n$$$ students participated in it. In this test, there is only one question and the answer to the question is an integer $$$x$$$. All the students gave their answers as integers, i.e., $$$a_i$$$ is the answer of the $$$i$$$-th$$$(1 \le i \le n)$$$ student. Student $$$i$$$ will pass the exam if |$$$x-a_i$$$| is the minimum possible among all the students who attended the exam.
Now your task is to answer $$$q$$$ queries of two types :
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 1000$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n,q$$$ ($$$1 \le n,q \le 2 \cdot 10^5$$$) — the number of students and the number of queries.
The second line of each test case contains $$$n$$$ space separated integers $$$a_{i}$$$ ($$$-10^9 \le a_{i} \le 10^9$$$) — the answer from the $$$i$$$-th student.
The next $$$q$$$ lines contain one of the two forms:
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$2 \cdot 10^5$$$.
It is guaranteed that the sum of $$$q$$$ over all test cases doesn't exceed $$$2 \cdot 10^5$$$.
For each test case — print the required answer for the $$$1$$$-st type query.
23 51 -2 31 1 3 02 3 -21 2 3 12 1 -41 1 1 -107 81 2 4 2 4 6 71 3 5 51 1 7 52 1 62 4 41 1 7 51 1 3 22 7 11 1 7 -1
1 2 1 2 3 5 1 1
| Name |
|---|


