2601. BalL

单点时限: 30.0 sec

内存限制: 256 MB

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?

输入格式

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.

输出格式

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.

样例

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
Output
1.00
1.58
2.00
100.00

0 人解决,1 人已尝试。

0 份提交通过,共有 1 份提交。

9.9 EMB 奖励。

创建: 15 年,8 月前.

修改: 7 年,2 月前.

最后提交: 3 年,12 月前.

来源: The 4th Baidu Cup Central China Invitational Programming Contest

题目标签