There are N sprinklers in a field. Each sprinkler has some range up to where it can sprinkle water.
All the sprinklers are on the X-axis at coordinates (X1,0), (X2,0), ...,(XN,0) and their respective ranges are R1, R2, R3,...,RN meaning that the ith sprinkler can sprinkle water from [Xi−Ri, Xi+Ri] inclusive.
There is a big wall at 0 meaning that the water can not go another side irrespective of range.
You are asked Q queries and in the ith query, you will be given an integer K. Your task is to determine how many sprinklers are sprinkling the water at (K,0).
Assume, there is no sprinkler at (0,0) and there is no query that has K=0.
Input format
Output format
For each test case, print Q lines denoting the number of sprinklers that sprinkle water at the position in the ith query.
Constraints
1≤T≤10000
1≤N≤100000
1≤Q≤N
1≤|Xi|≤N
0≤Ri≤N
−2N≤K≤2N
The sum of N over all test cases do not exceed 100000.
There are 3 sprinklers which sprinkle water at -3 which are at (-2,-1,-3). Note that sprinker at co-ordinate x=1 has range upto -4 but there is a big wall at x=0.
Similar is the case with -2 and -6.
There are two sprinklers at (1,2) which can sprinkle water at 5.