SP187 FLBRKLIN - Flat broken lines
Description
We have a cartesian coordinate system drawn on a sheet of paper. Let us consider broken lines that can be drawn with a single pencil stroke from the left to the right side of the sheet. We also require that for each segment of the line the angle between the straight line containing this segment and the OX axis belongs to \[-45°, 45°\] range. A broken line fulfilling above conditions is called a flat broken line. Suppose we are given _n_ distinct points with integer coordinates. What is the minimal number of flat broken lines that should be drawn in order to cover all the points (a point is covered by a line if it belongs to this line)?
Input Format
The number of test cases _t_ is in the first line of input, then _t_ test cases follow separated by an empty line.
In the first line of a test case there is one positive integer _n_, not greater than 30000, which denotes the number of points. In the following _n_ lines there are coordinates of points. Each line contains two integers _x_, _y_ separated by a single space, 0
Output Format
For each test case you should output one line with the minimal number of flat broken lines that should be drawn to cover all the points.