1301. Polygon

单点时限: 2.0 sec

内存限制: 256 MB

Write a program that:

1.reads the number of vertices of a polygon and its triangulation ;

2.computes the maximal number of triangles intersected by an elementary triangle of the given polygon;

3.writes the result.

输入格式

In the first line of the file WIE.IN there is a number n, 3<=n<=1000, which equals the number of vertices of the polygon. The vertices of the polygon are numbered from 0 to n-1 clockwise. The following n-2 lines describe the triangles in the triangulation. There are three integers separated by single spaces in the (i+1)-st line, where 1<=i<=n-2. These are the numbers of the vertices of the i-th triangle in the triangulation.

输出格式

In the first and only line of the file WIE.OUT there should be exactly one integer - the maximal number of triangles in the triangulation, that can be intersected by a single elementary triangle of the input polygon.

样例

Input
6
0 1 2
2 4 3
0 5 4
2 4 0
Output
4

1 人解决,2 人已尝试。

1 份提交通过,共有 4 份提交。

9.8 EMB 奖励。

创建: 16 年,9 月前.

修改: 6 年,8 月前.

最后提交: 10 月,2 周前.

来源: POI 1998 I Stage

题目标签