22398_IncidentalPoints

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

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

Pro.ID

22398

Title

Incidental Points

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    Unlike a straight line, a straight segment between two points P1, P2 (normally written as ) is a line that links the two points but doesn't extend beyond them. A third point P3 is said to be incident to iff P3 lies on the straight line and between the points P1 and P2. is said to include P3. By definition, P1 and P2 are included in . Write a program to find the segment that includes the most number of given points.

    输入

    Your program will be tested on one or more test cases. Each est case includes a set of two or more unique points, where the Cartesian coordinates of each point is specified on a separate line using two integers X and Y where 0 ≤ |X| , |Y| < 1,000,000. No test case has more than 1000 points. An input line made of two or more '-' (minus signs) signals the end of a test case. An extra input line of two or more '-' (minus signs) follow the last test case.

    输出

    Description

    Unlike a straight line, a straight segment between two points P1, P2 (normally written as ) is a line that links the two points but doesn't extend beyond them. A third point P3 is said to be incident to iff P3 lies on the straight line and between the points P1 and P2. is said to include P3. By definition, P1 and P2 are included in . Write a program to find the segment that includes the most number of given points.

    Input

    Your program will be tested on one or more test cases. Each est case includes a set of two or more unique points, where the Cartesian coordinates of each point is specified on a separate line using two integers X and Y where 0 ≤ |X| , |Y| < 1,000,000. No test case has more than 1000 points. An input line made of two or more '-' (minus signs) signals the end of a test case. An extra input line of two or more '-' (minus signs) follow the last test case.

    Output

    For each test case, output the result on a single line using the following format:

    k. n

    Where k is the test case number (starting at 1,)  ' ' is a single space, and n is the number of points on the segment.

    Sample Input

    1 1
    1 5
    5 9
    9 5
    5 5
    3 2
    5 3
    ----
    1 5
    5 1
    1 1
    5 5
    --
    --------

    Sample Output

    1. 4
    2. 2

    Source

    样例输入

    1 1
    1 5
    5 9
    9 5
    5 5
    3 2
    5 3
    ----
    1 5
    5 1
    1 1
    5 5
    --
    --------

    样例输出

    1. 4
    2. 2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部