Da7doo7 is facing this problem in a job interview and needs your help.
You are given an array $$$a$$$ of $$$n$$$ positive integers.
Every second, each of its border elements$$$^\dagger$$$ will decrease exactly by $$$1$$$. If at any moment some elements become zero, they will disappear from the array. For example:
You have to answer $$$q$$$ independent queries. In each query, you are given a number $$$s$$$ and you have to determine how many elements will remain after $$$s$$$ seconds.
$$$^\dagger$$$ An element of an array is considered a border element if and only if it is either the leftmost or rightmost element of the array.
If there is only one element remaining, then each second it will decrease by $$$1$$$, and not $$$2$$$.
The first line of the input contains one integer $$$T$$$ $$$(1\le T\le 10^3)$$$ representing the number of test cases.
The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$q$$$ ($$$1\le n, q \le 2\cdot 10^5$$$) denoting the length of the array $$$a$$$ and the number of queries respectively.
The second line of each test case contains $$$n$$$ integers $$$a_1, \ldots, a_n$$$ ($$$1\le a_i\le 10^6$$$) — the elements of array $$$a$$$.
Each of the next $$$q$$$ lines of each test case contains a single integer $$$s$$$ ($$$0\le s\le 10^{12}$$$) — the query.
It is guaranteed that the sum of $$$n$$$ over all test cases, as well as the sum of $$$q$$$, does not exceed $$$2\cdot 10^5$$$.
For each query, output how many elements will remain after $$$s$$$ seconds.
35 31 4 2 3 51525 41 2 2 1 5356101 35456
4 2 4 3 1 0 0 1 0 0