Tauren has an integer sequence $A$ of length $n$ (1-based). He wants you to invert an interval $[l, r]$ $(1 \leq l \leq r \leq n)$ of $A$ (i.e. replace $A_l, A_{l + 1}, \cdots, A_r$ with $A_r, A_{r - 1}, \cdots, A_l$) to maximize the length of the longest non-decreasing subsequence of $A$. Find that maximal length and any inverting way to accomplish that mission.
A non-decreasing subsequence of $A$ with length $m$ could be represented as $A_{x_1}, A_{x_2}, \cdots, A_{x_m}$ with $1 \leq x_1 < x_2 < \cdots < x_m \leq n$ and $A_{x_1} \leq A_{x_2} \leq \cdots \leq A_{x_m}$.