You are given an integer array A consisting of N elements. For each element, you are required to find the length of the valley that is defined as:
Let i be the current index and l and r be the leftmost and rightmost index satisfying this property a[l]>a[l+1].....>a[i−1]>a[i]<a[i+1]<...a[r−1]<a[r], then (r−l+1) is the length of the valley. Also, assume that if A is [7,2,1,5,7,9], then the answer is [1,2,6,3,2,1].
Explanation
Input format
Output format
Print T lines. For each test case, print N space-separated integers denoting the length of the valley for each index.
Constraints
1≤T≤20000
1≤N≤500000
1≤Ai≤109
Sum of N over all test cases does not exceed 1000000
-