1565_MysteriousMountain

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

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

Pro.ID

1565

Title

Mysterious Mountain

Title链接

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

AC

0

Submit

0

Ratio

-

时间&空间限制

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

    A group of M people is chasing a very strange animal. They believe that it will stay on a mysterious mountain T, so they decided to climb on it and have a loot. The mountain looks ordinary, shown below:

    That is, the outline of the moutain consists of N+1 segments. The endpoints of them are numbered 0..N+1 from left to right. That is to say, x[i] < x[i+1] for all 0 ≤ iN. And also, y[0]=y[N+1]=0, 1 ≤ y[i] ≤ 1000 for all 1 ≤ iN.

    According to their experience, the animal is most likely to stay at one of the N endpoits numbered 1..N . And ... funny enough, they soon discover that M=N, so each of them can choose a different endpoint to seek for the animal.

    Initially, they are all at the foot of the mountain. (i.e at (si,0) ) For every person i, he is planing to go left/right to some place (x,0) (where x is an integer -- they do not want to take time to work out an accurate place) at the speed of wi, then climb directly to the destination along a straight line (obviously, no part of the path that he follows can be OVER the mountain -- they can't fly) at the speed of ci. They don't want to miss it this time, so the team leader wants the latest person to be as early as possible. How fast can this be done?

    输入

    The input will contain no more than 10 test cases. Each test case begins with a line containing a single integer N ( 1 ≤ N ≤ 100 ). In the following N+2 lines, each line contains two integers xi and yi ( 0 ≤ xi, yi ≤ 1000 ) indicating the coordinate of the ith endpoints. in the following N lines, each line contains three intergers ci, wi and si describing a person ( 1 ≤ ci < wi ≤ 100, 0 ≤ si ≤ 1000 ) -- the climbing speed, walking speed and initial position. The test case containing N=0 will terminate the input and should not be regarded as a test case.

    输出

    Description

    A group of M people is chasing a very strange animal. They believe that it will stay on a mysterious mountain T, so they decided to climb on it and have a loot. The mountain looks ordinary, shown below:

    That is, the outline of the moutain consists of N+1 segments. The endpoints of them are numbered 0..N+1 from left to right. That is to say, x[i] < x[i+1] for all 0 ≤ iN. And also, y[0]=y[N+1]=0, 1 ≤ y[i] ≤ 1000 for all 1 ≤ iN.

    According to their experience, the animal is most likely to stay at one of the N endpoits numbered 1..N . And ... funny enough, they soon discover that M=N, so each of them can choose a different endpoint to seek for the animal.

    Initially, they are all at the foot of the mountain. (i.e at (si,0) ) For every person i, he is planing to go left/right to some place (x,0) (where x is an integer -- they do not want to take time to work out an accurate place) at the speed of wi, then climb directly to the destination along a straight line (obviously, no part of the path that he follows can be OVER the mountain -- they can't fly) at the speed of ci. They don't want to miss it this time, so the team leader wants the latest person to be as early as possible. How fast can this be done?

    Input

    The input will contain no more than 10 test cases. Each test case begins with a line containing a single integer N ( 1 ≤ N ≤ 100 ). In the following N+2 lines, each line contains two integers xi and yi ( 0 ≤ xi, yi ≤ 1000 ) indicating the coordinate of the ith endpoints. in the following N lines, each line contains three intergers ci, wi and si describing a person ( 1 ≤ ci < wi ≤ 100, 0 ≤ si ≤ 1000 ) -- the climbing speed, walking speed and initial position. The test case containing N=0 will terminate the input and should not be regarded as a test case.

    Output

    For each test case, output a single line containing the least time that these people must take to complete the mission, print the answer with two decimal places.

    Sample Input

    3
    0 0
    3 4
    6 1
    12 6
    16 0
    2 4 4
    8 10 15
    4 25 14
    0

    Sample Output

    1.43

    Hint

    In this example, Person 1 goes to (5,0) and climbs to endpoint 2, Person 2 climbs directly to endpoint 3. person 3 goes to (4,0) and climbs to endpoint 1. Shown below:

    Source

    样例输入

    3
    0 0
    3 4
    6 1
    12 6
    16 0
    2 4 4
    8 10 15
    4 25 14
    0

    样例输出

    1.43

    提示

    In this example, Person 1 goes to (5,0) and climbs to endpoint 2, Person 2 climbs directly to endpoint 3. person 3 goes to (4,0) and climbs to endpoint 1. Shown below:


    路过

    雷人

    握手

    鲜花

    鸡蛋

    最新评论

    返回顶部