#P5939. [POI 1998 R3] 折线
[POI 1998 R3] 折线
Problem Description
A 2D Cartesian coordinate system is given.
We require that a polyline can be drawn in one stroke only from left to right, and the angle between each segment of the polyline and the -axis is in .
A polyline that satisfies the above requirements is called a straight polyline.
Given lattice points on the coordinate plane, what is the minimum number of straight polylines needed to cover all the points?
Input Format
The first line contains a positive integer , representing the number of points.
The next lines each contain two integers , representing the coordinates of the -th point.
Output Format
Output a single integer, representing the minimum number of straight polylines required.
5
2 3
3 4
4 5
1 6
12 27
3
6
1 6
10 8
1 5
2 20
4 4
6 2
3
Hint
For of the testdata, , .
Translated by ChatGPT 5