21447_Intervals

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

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

Pro.ID

21447

Title

Intervals

Title链接

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

AC

3

Submit

10

Ratio

30.00%

时间&空间限制

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

    In the ceiling in the basement of a newly open developers building a light source has been installed. Unfortunately, the material used to cover the floor is very sensitive to light. It turned out that its expected life time is decreasing dramatically. To avoid this, authorities have decided to protect light sensitive areas from strong light by covering them. The solution was not very easy because, as it is common, in the basement there are different pipelines under the ceiling and the authorities want to install the covers just on those parts of the floor that are not shielded from the light by pipes. To cope with the situation, the first decision was to simplify the real situation and, instead of solving the problem in 3D space, to construct a 2D model first.

    Within this model, the x-axis has been aligned with the level of the floor. The light is considered to be a point light source with integer co-ordinates [ bx, by ]. The pipes are represented by circles. The center of the circle i has the integer co-ordinates [ci,x , ci,y ] and an integer radius ri . As pipes are made from solid material, circles cannot overlap. Pipes cannot reflect the light and the light cannot go through the pipes. You have to write a program which will determine the non-overlapping intervals on the x-axis where there is, due to the pipes, no light from the light source.

    输入

    The input file consists of blocks of lines, each of which except the last describes one situation in the basement. The first line of each block contains a positive integer number N < 500 expressing the number of pipes. The second line of the block contains two integers bx and by separated by one space. Each of the next N lines of the block contains integers ci,x , ci,y and ri , where ci,y + ri < by . Integers in individual lines are separated by one space. The last block consists of one line containing N = 0.

    输出

    Description

    In the ceiling in the basement of a newly open developers building a light source has been installed. Unfortunately, the material used to cover the floor is very sensitive to light. It turned out that its expected life time is decreasing dramatically. To avoid this, authorities have decided to protect light sensitive areas from strong light by covering them. The solution was not very easy because, as it is common, in the basement there are different pipelines under the ceiling and the authorities want to install the covers just on those parts of the floor that are not shielded from the light by pipes. To cope with the situation, the first decision was to simplify the real situation and, instead of solving the problem in 3D space, to construct a 2D model first.

    Within this model, the x-axis has been aligned with the level of the floor. The light is considered to be a point light source with integer co-ordinates [ bx, by ]. The pipes are represented by circles. The center of the circle i has the integer co-ordinates [ci,x , ci,y ] and an integer radius ri . As pipes are made from solid material, circles cannot overlap. Pipes cannot reflect the light and the light cannot go through the pipes. You have to write a program which will determine the non-overlapping intervals on the x-axis where there is, due to the pipes, no light from the light source.

    Input

    The input file consists of blocks of lines, each of which except the last describes one situation in the basement. The first line of each block contains a positive integer number N < 500 expressing the number of pipes. The second line of the block contains two integers bx and by separated by one space. Each of the next N lines of the block contains integers ci,x , ci,y and ri , where ci,y + ri < by . Integers in individual lines are separated by one space. The last block consists of one line containing N = 0.

    Output

    The output file consists of blocks of lines, corresponding to the blocks in the file (except the last one). One empty line must be put after each block in the output file. Each of the individual lines of the blocks in the output file will contain two real numbers, the endpoints of the interval where there is no light from the given point light source. The reals are exact to two decimal places and separated by one space. The intervals are sorted according to increasing x-coordinate.

    Sample Input

    6
    300 450
    70 50 30
    120 20 20
    270 40 10
    250 85 20
    220 30 30
    380 100 100
    1
    300 300
    300 150 90
    1
    300 300
    390 150 90
    0

    Sample Output

    0.72 78.86
    88.50 133.94
    181.04 549.93

    75.00 525.00

    300.00 862.50

    Source

    样例输入

    6
    300 450
    70 50 30
    120 20 20
    270 40 10
    250 85 20
    220 30 30
    380 100 100
    1
    300 300
    300 150 90
    1
    300 300
    390 150 90
    0

    样例输出

    0.72 78.86
    88.50 133.94
    181.04 549.93

    75.00 525.00

    300.00 862.50

    作者


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部