You are given an array A of length N sorted in non-decreasing order and an integer X. Find the number of subarrays such that the sum of the minimum and maximum element of that subarray is less than or equal to X.
Input Format:
Output Format:
For each test case, print the number of subarrays such that the sum of the minimum and maximum element of that subarray is less than or equal to X.
Constraints:
1≤T≤101≤N≤1051≤A[i],X≤105
For first test case:
Subarray is [3]. Hence, the answer is 1.
For second test case:
Subarrays are [1], [1, 3]. Hence, the answer is 2.