Fence Watch
Time limit1sMemory limit128 MB
Place the fewest sensors on a convex polygon boundary so every boundary point forms an angle from alpha to 360 degrees minus alpha with some sensor pair.
Problem
An exhibition room of the National Museum holds a knife that is 5000 years old. The knife is one of the most valuable relics the museum owns, so a fence shaped like a convex polygon surrounds it and keeps spectators away. Two or three watchmen have to guard the fence at all times, and that costs the museum a lot of money.
The museum decided to protect the knife and the fence automatically instead. The plan is to install several sensors that watch the fence. Once the sensors watch the fence properly, the museum sees the fence and its interior clearly. The sensor the museum picked has these properties.
- A sensor does not work alone. It works together with another sensor.
- A pair of sensors placed at points and sees every point with , where .
- Every sensor sits on the floor and on the boundary of the fence. When a point on the floor is watched, every point directly above it is watched as well.
A point that holds a sensor is watched by that sensor.
You are given the convex polygon of the fence and the value of . Find the smallest number of sensors that watch every point on the boundary of the fence. The figure below shows a fence and one placement of the minimum number of sensors for . The pair of sensors , watches only the points inside the gray region.

No three consecutive vertices lie on one line.
Input
Your program reads from standard input. The first line holds the number of test cases (). The first line of each test case holds () and the number of vertices () of the convex polygon. The next lines hold the coordinates of the vertices in counter-clockwise order, one vertex per line. Every coordinate lies in . All input values are integers, and integers on one line are separated by a single space.
Output
Your program writes to standard output. For each test case print one line with the smallest number of sensors that watch the boundary of the given convex polygon properly.