Let initially be the sequence . At any point during the process, let denote the current length of and let denote its -th element.
You may perform the following operation any number of times.
Choose an index () satisfying . Remove the elements from . The remaining elements, in their original order, form the new sequence .
Determine whether can be made empty. If so, find the minimum and maximum possible numbers of operations required.
输入格式
The input consists of a single test case of the following format.
N
A_1 A_2 ... A_N
The first line contains an integer (), representing the length of the sequence.
The second line contains integers ().
输出格式
Print lines.
For each (), the -th line should contain the answer for . If it is impossible to make empty, print -1. Otherwise, print two integers: the minimum and maximum possible numbers of operations required to make empty, respectively.