|
||||||||||
Collapse!!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 116 Accepted Submission(s): 0 Problem Description Candy and his friends found a treasure map. With the help of the map, they successfully found the treasure inside an ancient cave, but just as they took the large treasure box, the cave started to collapse! Candy must find a way out, but the rocks are falling down so quickly that it's impossible to run out with bare feet. After carefully examined the treasure box, they found a digit panel, a button, and a small piece of paper. "I am not an ordinary treasure box, I am a mini-spaceship, your last hope to escape. Use the digit panel to setup my speed, then press the button to launch. I'll fly from left to right, until I reach the exit. The trouble is: I am very weak. I'll explode immediately when hit by any falling rock, but if I'm just touching one, it's ok. When flying, I burn the treasures inside. The higher my speed is, the more treasures I will burn. Thus, be sure to find an appropriate speed before starting your journey. The last thing you need to know is: don't be too slow. The exit will be blocked after a while." Fig 1. Collision between the spaceship and a rock A list of rocks that will fall down is enclosed in that piece of paper. All the rocks have the same speed. Each rock continues to fall down until its topmost point reaches the land (i.e. y = 0).You can start your journey at any time, but once you launch the spaceship, it never stops before reaching the exit or being destroyed! Write a program to find the minimal speed that takes you out of the cave. Input The input contains several test cases. The first line of each case contains seven positive integers n, a, b, L, H, V, T (1 ¡Ü n ¡Ü 50, 1 ¡Ü a, b ¡Ü 10, 1 ¡Ü L, H, V, T ¡Ü 10000). The spaceship is a units wide and b units high. Its bottom-left corner is initially (i.e. at time 0) at (0, 0). When the bottom-left corner reaches (L, 0) before time T, you succeeded. The height of the cave is H. The speed of each rock is V. There are n lines followed. Each of these lines contains three integers x, r, t (1 ¡Ü t ¡Ü T, 1 ¡Ü r ¡Ü 200, a + r ¡Ü x ¡Ü L - r, b < H - r): at time t, there will be a falling rock with a radius of r with its center at (x, H). The descriptions of rocks are sorted in increasing order of falling time. The last test case is followed by a single zero, which should not be processed. Output For each test case, print the case number and the minimal speed to two decimal places. It is always possible to escape. Sample Input
Sample Output
Source | ||||||||||
|