Thank you for participating in our contest! We hope you enjoyed it. Implementations will be added soon (when Codeforces lets authors submit solutions!).
Please let us know what you thought of the problems by voting!
In a palindrome, the first and last characters are equal, the second and second last characters are equal, ...
Think small, then big!
Consider the cycles in the permutation. What cycles can there be?
Try separating the even and odd cases.
What do two clocks with assigned values on the same column tell us about their respective rows?
If we are modifying a point already in an interval, how can we grow/split the interval to maintain balance?