Problem C
Polyline Simplification
Mapping applications often represent the boundaries of countries, cities, etc. as polylines, which are connected sequences of line segments. Since fine details have to be shown when the user zooms into the map, these polylines often contain a very large number of segments. When the user zooms out, however, these fine details are not important and it is wasteful to process and draw the polylines with so many segments. In this problem, we consider a particular polyline simplification algorithm designed to approximate the original polyline with a polyline with fewer segments.
A polyline with
Consider the example below.
![\includegraphics[width=0.8\textwidth ]{diagram.pdf}](/problems/simplification/file/statement/en/img-0001.png)
The original polyline is shown at the top. The area of the
triangle formed by
Input
The first line of input contains two integers
Output
Print on the
Sample Input 1 | Sample Output 1 |
---|---|
10 7 0 0 1 10 2 20 25 17 32 19 33 5 40 10 50 13 65 27 75 22 85 17 |
1 9 6 |