Today is YQH's birthday, and she received a permutation of $1 \sim n$ as a gift.
YQH is a perfectionist, and she wants to sort this permutation in ascending order. Specifically, she can perform the following operation:
- Divide the range $[1, n]$ into several segments, say $m$ segments: $[l_1, r_1], [l_2, r_2], \dots, [l_m, r_m]$, where $l_1 = 1, r_m = n, l_{i+1} = r_i + 1$, and $l_i \le r_i$.
- If the original permutation is $a_{1, \dots, n}$, the permutation becomes $a_{l_m}, a_{l_m+1}, \dots, a_{r_m}, a_{l_{m-1}}, a_{l_{m-1}+1}, \dots, a_{r_{m-1}}, \dots, a_{l_1}, a_{l_1+1}, \dots, a_{r_1}$. That is, treat each segment as a single block and reverse the order of these blocks in the permutation.
YQH wants to sort the sequence in ascending order using as few operations as possible. However, she is not very clever, so she has asked for your help. Note that you do not need to find the minimum number of operations.
Input
The first line contains a positive integer $n$, representing the length of the permutation.
The second line contains $n$ integers $a_1, a_2, \dots, a_n$, representing the permutation YQH received. It is guaranteed that $a_{1, \dots, n}$ is a permutation of $1 \sim n$.
Output
The first line contains an integer $p$, representing the number of operations you perform.
The next $p$ lines each start with an integer $m$, representing that you divide the permutation into $m$ segments for this operation. This is followed by $m$ integers $len_i$, representing the length of the $i$-th segment (i.e., $len_i = r_i - l_i + 1$). You must ensure that $\sum_{i=1}^m len_i = n$.
Examples
Input 1
4 3 1 2 4
Output 1
2 2 3 1 3 1 1 2
Note 1
In the first operation, the sequence is divided into $[3, 1, 2], [4]$, and after the operation, it becomes $[4, 3, 1, 2]$.
In the second operation, the sequence is divided into $[4], [3], [1, 2]$, and after the operation, it becomes $[1, 2, 3, 4]$.
Input 2
6 6 5 4 3 2 1
Output 2
1 6 1 1 1 1 1 1
Note 2
In the first operation, the sequence is divided into $[6], [5], [4], [3], [2], [1]$, and after the operation, it becomes $[1, 2, 3, 4, 5, 6]$.
Input 3
1 1
Output 3
0
Note 3
The original sequence is already sorted, so no operations are needed.
Constraints
This problem uses scoring parameters for evaluation. Specifically, for each test case, we have scoring parameters $p_0, p_1, p_2, p_3, p_4$, where $p_i \ge p_{i+1}$. If your number of operations is $p$, your score for that test case is:
$$ \frac{[p\le p_0]+\sum_{i=0}^3 \max(\frac{p_i-\max(p,p_{i+1})}{p_i-p_{i+1}},0)}{5} $$
where $0/0=1$ and $-1/0=-\infty$.
For each subtask, if the subtask score is $w$, your score is the minimum score among all test cases in that subtask multiplied by $w$.
- Subtask 1: 10 pts, $n \le 8, p_0 = p_1 = p_2 = p_3 = p_4 = 10^6$.
- Subtask 2: 20 pts, $n \le 200, p_0 = p_1 = p_2 = p_3 = p_4 = 40000$.
- Subtask 3: 70 pts, $n = 20000, p_0 = 1000, p_1 = 500, p_2 = 240, p_3 = 140, p_4 = 90$.