시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 2048 MB189753.846%

문제

You are given an integer $N$ and an array of integers $[y_1, y_2, \ldots, y_N]$ of size $N$.

You want to construct the following:

  • a polynomial $P(x) = c_0 x^0 + c_1 x^1 + \ldots + c_d x^d$ where the coefficients are real numbers, and for some degree $d$;
  • an array of real numbers $[x_1, x_2, \ldots, x_N]$ of size $N$ such that $x_1 < x_2 < \ldots < x_N$;

and the construction satisfies $P(x_1) = y_1$, $P(x_2) = y_2$, $\ldots$, $P(x_N) = y_N$.

It can be proven that such a construction always exists. Your task is to find the minimum polynomial degree $d$ that you can construct.

입력

The first line contains an integer $N$ ($1 \leq N \leq 100000$). The second line contains $N$ integers representing $y_i$ ($-10^9 \leq y_i \leq 10^9$).

출력

Output the minimum degree $d$ in a single line.

예제 입력 1

5
2 -1 1 1 0

예제 출력 1

3

예제 입력 2

5
1 0 0 0 1

예제 출력 2

4

예제 입력 3

3
0 0 0

예제 출력 3

0

노트

Explanation of Sample 1: We can construct a polynomial $\frac{29}{3} x^0 + 8x^1 + 0 x^2 - \frac{2}{3} x^3$, and array $[-2.81273..., -2, -1.24361..., 3.86937..., 3.91423...]$.