10266_ClicktheLines

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

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

Pro.ID

10266

Title

Click the Lines

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    In many graphic drawing applications, you can click on a line object. A well-known approach to detect if a line is clicked by a mouse is to compute the distance between the click position and the line. For example, in Figure 1, the line is said to be selected if the distance d is less than a threshold D (dD).

    Give you a set of lines (with equation of the form ax + by + c = 0), please compute the minimum clicks to select all the lines. For example, to select two lines, the minimum number of clicks is one, that is, you can make a click near the cross point of the two lines.

    Note: In the test data, each line at least intersects with another line.

    输入

    The first line of input data begins with a number N the number of test cases. Each test case begins with two integers L and D, where L (L ≤ 200) is the number of lines and D (D > 0) is the threshold for testing if a line is selected. The data of lines listed one by one. Each line is represented by (ax + by + c = 0). The three floating numbers a, b, c, separated by space are given to represent the line.

    输出

    Description

    In many graphic drawing applications, you can click on a line object. A well-known approach to detect if a line is clicked by a mouse is to compute the distance between the click position and the line. For example, in Figure 1, the line is said to be selected if the distance d is less than a threshold D (dD).

    Give you a set of lines (with equation of the form ax + by + c = 0), please compute the minimum clicks to select all the lines. For example, to select two lines, the minimum number of clicks is one, that is, you can make a click near the cross point of the two lines.

    Note: In the test data, each line at least intersects with another line.

    Input

    The first line of input data begins with a number N the number of test cases. Each test case begins with two integers L and D, where L (L ≤ 200) is the number of lines and D (D > 0) is the threshold for testing if a line is selected. The data of lines listed one by one. Each line is represented by (ax + by + c = 0). The three floating numbers a, b, c, separated by space are given to represent the line.

    Output

    Please output the minimum number of clicks in a new line for each test case.

    Sample Input
    2
    2 5
    0 1 0
    1 0 0
    3 1
    0 1 0
    1 0 0
    1 1 2
    Sample Output
    1
    2
    Source

    样例输入

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

    样例输出

    1
    2

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部