Sorry, maybe the topic is different from what you think.
Ms.D has a habit of saving money, and she is a man with a plan, so she makes a schedule for herself to save money.
From the first day, the amount of money deposited each day is the same as the number of days, such as $3 on day 3, $10 on day 10...
Ms. D was very happy with her plan, but her friend Mr. X wanted to tease her, so Mr. X secretly changed her plan.
Mr. X would pick an interval [l, r] and reverse it. At that the segment's endpoints did not coincide.
For example, if n = 5,Ms. D’s plan should be saved in order 1 2 3 4 5.if Mr. X chose the segment[2,4], then after the reversal the plan order will change to 1 4 3 2 5.
Mr.X suspects that someone else could have spoilt the permutation after Ms.D. Help him to find that out.
Check if the given permutation can be obtained from the permutation 1 2 ... n using exactly one segment reversal. If it is possible, find the segment itself.
7 2 3 4 5 6 7 1 10 1 2 3 7 6 5 4 8 9 10 5 1 2 3 4 5
0 0 4 7 0 0