CF56B Spoilt Permutation

题目描述

给出一个长度为 $ n $ 的序列(保证序列中 $ 1-n $ 每个数有且仅出现1次),问能否恰好反转序列中的一段,使得序列变成 $ 1,2...n $ 的顺序。

输入格式

The first line contains an integer $ n $ ( $ 1

输出格式

If it is impossible to obtain the given permutation from the original one in exactly one action, print 0 0. Otherwise, print two numbers $ l $ $ r $ ( $ 1