F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

Ball

Time Limit: 60000/20000 MS (Java/Others)    Memory Limit: 62768/62768 K (Java/Others)
Total Submission(s): 164    Accepted Submission(s): 2


Problem Description
Members of Wuhan University ACM Team are fond of playing little games. Ball game is one of them, which is
played with a ball on a rectangle board. The ball should be rolled from the start point to the end point. The
game board is surrounded by walls and contains rectangular obstacles with known dimensions. Obstacles will
not overlap with each other. The ball cannot leave the board, nor can it fly.

Now, you're one of the competitors. Can you find the radius of the largest ball to complete the task?
 

Input
The input consists of multiple test cases. The first line of input contains an integer T, which is the number of
test cases.Each test case is on several lines. The first line contains four integers: N, L, W, H, indicating the
number of obstacles; the length, width of the board; and the height of walls.

The coordinate of the lower-left corner is (0,0), the upper-right one is (L, W).

Each of the following N lines consists of five integers: Xi, Yi, Li, Wi, Hi, indicating the coordinate of the
lower-left corner of an obstracle and it's length, width and height. So the upper-right corner of the obstracle
is (Xi + Li, Yi + Wi).

The last line of a test case consists of four integers: Sx, Sy, Tx, Ty which indicate the coordinates of
start point:(Sx, Sy), and end point:(Tx, Ty).

[Technical Specification]
T is an integer, and T <= 50.
N is an integer, and 0 <= N <=10.
All integers EXCEPT N are in the range [1, 1000].
You can assume those obstracles? sides are parallel to OX, OY and OZ axis, the start point and end point are
rightful(not outside the board or inside an obstracle).
All part of an obstracle is in the board.
The integers on the same line are separated by ONE space.
The test cases are separated by ONE empty line.
NO other spaces or lines will appear in the test data.
 

Output
For each test case, print a single line consists of the radius of the largest ball, rounded to two fractional
digits. Output '0.00'(without quotes) if there is no ball can reach its end point from the start point.
 

Sample Input
4 3 1000 1000 42 102 101 3 2 468 106 104 2 3 335 100 107 4 1 501 101 106 106 100 4 1000 1000 170 108 103 2 3 725 105 109 4 1 479 101 104 1 4 359 103 101 2 2 963 100 100 105 106 2 1000 1000 465 102 100 2 3 706 106 103 2 3 146 100 103 110 103 0 1000 1000 282 100 100 102 102
 

Sample Output
1.00 1.58 2.00 100.00
 

Source
 

Statistic | Submit | Discuss | Note
Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-11-22 20:14:08, Gzip enabled