Mountains

아직 제출이 없습니다시간 제한1초메모리 제한512 MB

문제

Tahmuras, the third king of ancient Persia, has conquered a huge army of deevs (demons). He wants to imprison as many of them as possible in Alborz mountains and let the others go. Alborz is a mountain range with a skyline that looks like a polygonal chain with nn vertices. The ii-th vertex (for all 0in10 \le i \le n - 1) has coordinates (i,y\[i])(i, y\[i]), i.e. with longitude ii and altitude y\[i]y\[i].

The deevs can be imprisoned on different vertices. No two imprisoned deevs should be able to see each other; otherwise, they will make eye contact and plan to escape. Two deevs cannot see each other if there is at least one vertex between them that is strictly higher than a line connecting their vertices.

In the following figure, a deev on vertex 00 can see deevs on vertices 11 and 22. But it cannot see deevs on vertices 33, 44 and 55, since vertex 22 is higher than the line connecting vertex 00 to any of vertices 33, 44, or 55.

Your task is to help Tahmuras find the maximum number of deevs that can be imprisoned in Alborz mountains.

제한

  • 1n20001 \leq n \leq 2000,
  • 0y\[i]1090 \leq y\[i] \leq 10^9 (for all 0i<n0 \leq i < n).