The MEX of an array is the minimum non-negative integer that is not present in it. For example,
You are given a permutation P of the integers {0,1,2,…,N−1}.
For each i from 1 to N, find the number of subarrays of the permutation P such that the MEX of the subarray is equal to i.
An array B is a subarray of an array A if B can be obtained from aa by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end. In particular, an array is a subarray of itself.
Input format
Output format
For each test case, print N space-separated integer where the ith integer denotes the number of subarrays of the permutation P such that the MEX of the subarray is equal to i.
Constraints
1≤T≤1051≤N≤3⋅1050≤Pi≤N−1,Pi≠Pj for each 1≤i<j≤NSum of N over all test cases does not exceed 3⋅105.
In the first test case,
The subarray with MEX = 2 is : [0,1].
The subarray with MEX = 3 is : [2,0,1].