The 1st Annual Guangdong Collegiate Programming Contest (GDCPC) was held in Zhuhai Campus of Zhongshan (Sun Yat-Sen) University last year. And now we gather again for the 2nd GDCPC in the same wonderful place. After the contest, most of the participants will probably have a jaunt around the beautiful Campus.
As you have seen, the main attraction of this place is the green hills surrounding. And a problem comes up now. What is the area of cross section of the hills?
This range of hills contains peaks and valleys. So before calculating the area, we have to firstly scale and write down the coordinates of the turning points. In the following graph, 7 turning points of a hill are marked.