#SDNU1497. Problem_F
Problem_F
Description
Spring is coming, God Chao become rutting. So God Chao wants to expand his harem.
Although sooooooo~ many beauties want to join his harem, not everyone can enter, because God Chao is particular about beauties.(In fact, he love fat girl. XD) He wants to choose beauties by this way:
First of all, he lets the girls stand in a row, gives each girl a face score. And then you should consider his one strange hobby. He wants to bring some beauties that their face scores in a range into his harem. But how to find this range? God Chao thinks that the interval is the widest range and face scores in this interval should be “the first rise and then fall”.(the scores of this interval must rise to a point and then fall, and the length between the ascending and descending intervals must be greater than 0).
You should find this interval and output the left subscript and the right subscript of this interval. If you cannot find this interval, please output “-1 -1”.
Format
Input
The first line is a number means numbers. And then numbers mean the beauties’ face scores.
Output
One line contains two numbers. The left subscript and the right subscript or “-1 -1”.
Samples
10
1 3 1 2 5 4 3 1 9 10
2 7