<PREV Problem:
NEXT>
Solved by 61 users: ...
UserDateAttemptTimeCMSC
ripatti25 jul 2010C++1700.01662 
ripatti25 jul 2010C++1800.01665 
tomek12 apr 2006C++600.01787 
Mishunin_Alexander22 oct 2007C++600.02842 
ripatti25 jul 2010C++1600.01860 
ilia09 jul 2014C++300.02885 
Vyshnya07 jan 2010C++1300.01890 
RAVEman24 jan 2008C++1600.01890 
RAVEman24 jan 2008C++1500.01891 
WsemirZ02 aug 2008Kylix600.01905 
WsemirZ02 aug 2008Kylix700.01906 
WsemirZ02 aug 2008Kylix500.01907 
Tulegenov_Amir11 aug 2007Kylix400.01909 
Slam11 mar 2005C++800.02914 
WsemirZ02 aug 2008Kylix400.01923 
grom16 oct 2004FPC200.01929 
WsemirZ02 aug 2008Kylix300.01929 
Languages
C++
33
FPC
19
Kylix
9
C
1
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 
 > 

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 220ms

SW soft NIX
ID = 3.235.105.97