
ZOJ Problem Set  2843
Octopus and Penguin love sports, especially the climb. They step on the most top building of Changsha to view the Yuelu Mountain in weekend and are attracted by the imposing landscape. However, they can't see the whole mountain because the building is not high enough. Please help them to calculate the total length of surface for mountain they can see.
The figure below corresponding sample input one: Input There are several test cases. For each case, the first line is two integers n (0<n<=1000) and h. Then n lines follow and each line is two integers x and y(0<=x,y<=1000) describe the coordinates of mountains. n=h=0 means end of the input. Output For each case, output the surface length of mountain they can see. Sample Input 3 5 0 0 1 1 2 0 5 5 0 0 2 2 3 1 5 3 8 0 5 4 0 0 2 2 3 1 5 3 8 0 0 0 Sample Output 2.83 7.07 5.66 Author: Liu Sy., zzningxp Source: South Central China 2007 hosted by NUDT 