ZOJ Problem Set - 3590
ZOJ is 10 years old! For celebrating, we are offering the easiest problem in the world to you.
Recently we received a long sequence. We can modify the sequence once by the following two steps.
Now, we want to know how many times at most the sequence can be modified.
The input contains multiple test cases. For each case, the first line contains an integer n(1 ≤ n ≤ 20000). The second line contains n integers describing the sequence. All the numbers in the sequence are non-negative and not greater than 1000000.
Output number of times at most the sequence can be modified, one line per case.
1 10 2 10 11
Author: ZHUANG, Junyuan
Contest: ZOJ 10th Anniversary Contest