<PREV Problem:
NEXT>
Solved by 61 users: ...
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 
 < 

Rain

Time limit = 5

It is raining in one of the two-dimantional worlds. Relief is described by N-points polygon: (x0, y0), ..., (xN, yN), where x0 < x1 < ... < xN and yiyj for any i,j, ij.

In x0 and xN there are very high vertical walls.

If relief is plain, than depth of resulted pond is H.

But our relief is not plain, and there may be several ponds. Your program should calculate maximum water-depth in the ponds.

Input In the first line N and H are given. N is positive integer, (0 ≤ N ≤ 100) and H is real(floating-point number) (0 ≤ H ≤ 109). Next (N+1) lines describe the polygon. Each line contains two numbers xi and yi, -10000 ≤ xi, yi ≤ 10000 (0 ≤ iN), delimited with space.

Output One floating-point number with accuracy 0.0001.

Input#1
7 7.000
-5 10
-3 4
-1 6
1 -4
4 17
5 3
9 5
12 15
Output#1
15.8446

Author:
School olympiad, Perm
april 2002

<PREV | Problem set | Search related messages | NEXT>


© acm.mipt DevGroup
The page was generated in 200ms

SW soft NIX
ID = 54.198.246.116