21635_Pancake

2022-5-16 18:20| 发布者: Hocassian| 查看: 31| 评论: 0|原作者: 肇庆学院ACM合集

摘要:
C:\Users\Administrator\Downloads\2019-10-12-10-14-4-89505709184300-Problem List-采集的数据-后羿采集器.html

Pro.ID

21635

Title

Pancake

Title链接

http://10.20.2.8/oj/exercise/problem?problem_id=21635

AC

0

Submit

0

Ratio

-

时间&空间限制

  • Time Limit: 2000/1000 MS (Java/Others)     Memory Limit: 65536/65536 K (Java/Others)
  • 描述

    One time, Anthony has made a pancake, whose shape is a simple polygon. Anthony wants to cut the pancake into pieces with a knife. He is wondering what the maximum number of pieces he can get after one single cut is. He needs your help.

    Figure 1  example

    Notice that you can not cut the pancake through a vertex, as in Figure 1.

    输入

    The input is a sequence of data sets, each has the following format.

    n

    x1  y1

    ...

    xn  yn

    The first line contains an integer n ( 3 ≤ n ≤ 100 ), which is the number of vertices. And the following n lines contains n different point, each line represents a vertex. Edges of the polygon connect vertices given in two adjacent vertex data lines, and in the last and the first vertex data lines. ( -100000000 ≤ xi, yi ≤ 100000000, both are integers ).

    Edges intersect only at vertices. Three vertices may stand on one line.

    The input is ended by n = 0.

    输出

    Description

    One time, Anthony has made a pancake, whose shape is a simple polygon. Anthony wants to cut the pancake into pieces with a knife. He is wondering what the maximum number of pieces he can get after one single cut is. He needs your help.

    Figure 1  example

    Notice that you can not cut the pancake through a vertex, as in Figure 1.

    Input

    The input is a sequence of data sets, each has the following format.

    n

    x1  y1

    ...

    xn  yn

    The first line contains an integer n ( 3 ≤ n ≤ 100 ), which is the number of vertices. And the following n lines contains n different point, each line represents a vertex. Edges of the polygon connect vertices given in two adjacent vertex data lines, and in the last and the first vertex data lines. ( -100000000 ≤ xi, yi ≤ 100000000, both are integers ).

    Edges intersect only at vertices. Three vertices may stand on one line.

    The input is ended by n = 0.

    Output

    Output one integer for each input case, representing the largest number of pieces.

    Sample Input

    5
    0 0
    2 0
    2 2
    1 1
    0 2
    0

    Sample Output

    3

    Source

    样例输入

    5
    0 0
    2 0
    2 2
    1 1
    0 2
    0

    样例输出

    3

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部