You are given a permutation of the integers from to . Determine the number of contiguous segments whose is smaller than the main permutations .
Formally , count how many subarrays of the array since the count can be very large print it modulus 9973 where is permutation of \{1,2,3,..,n\} such that
First line of input will contain a single integer (1\le t\le 10^4) denoting the number of test cases.
The first line of each test case contains two lines of input in first line a integer (1\le n\le 10^5) — the length of permutation .
The second line contains a sequence of integer p_1,p_2,p_3,...,p_n where (1\le p_i\le n) and (p_i \neq p_j; i \neq j).
It's guaranteed that \sum n \le 10^5 holds overall test cases
Print the total number of segment that satisfy the condition mod 9973.
Example 1
In second test case the possible segments are so the answer is .
Subtask ( points) : (1 \le \sum n \le 100)
Subtask ( points) : (1 \le \sum n \le 1000)
Subtask ( points) : No additional constraints