| Online MIPT programming contest | РУССКИЙ |
| <PREV Problem: | NEXT> |
< |
|---|
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 yi ≠ yj for any i,j, i ≠ j.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 ≤ i ≤ N), delimited with space.
Output One floating-point number with accuracy 0.0001.
Input#17 7.000 -5 10 -3 4 -1 6 1 -4 4 17 5 3 9 5 12 15 |
Output#115.8446 |
Author:
School olympiad, Perm
april 2002
© acm.mipt DevGroup The page was generated in 350ms |