#P2924. [USACO08DEC] Largest Fence G
[USACO08DEC] Largest Fence G
Description
Farmer John has purchased () fence posts in order to build a very nice-looking fence. Everyone knows the best fences are convex polygons where fence posts form vertices of a polygon. The pasture is represented as a rectilinear grid; fencepost is at integer coordinates ().
Given the locations of fence posts (which, intriguingly, feature no set of three points which are collinear), what is the largest number of fence posts FJ can use to create a fence that is convex?
For test cases worth of the points for this problem, .
Input Format
-
Line : A single integer: .
-
Lines : Line describes fence post 's location with two space-separated integers: and .
Output Format
- Line : A single integer, the maximum possible number of fence posts that form a convex polygon.
6
5 5
2 3
3 2
1 5
5 1
1 1
5
Hint
A square with two points inside.
The largest convex polygon is the pentagon .
京公网安备 11011102002149号