Cows
Time limit1sMemory limit128 MB
Given up to 10000 tree coordinates, find the largest convex polygon using any subset as corners, then output its area divided by 50 rounded down.
- Level
Medium6 of 10
- Topics
- Geometry, Sorting, Array, Brute force
- Solved
- No attempts yet
Problem
Farmers want to save money by using the trees that grow on their land as fence posts, so they can build the largest possible pasture. You are given the locations of some trees. Consider the largest pasture (a convex polygon) that can be built using some or all of these trees as its corners. Not every tree has to be used.
What you must determine is how many cows can be placed in that pasture. It is well known that a cow needs at least square metres of pasture to survive. Therefore the answer is the area of the largest possible pasture divided by , rounded down.
Input
The first line contains a single integer (), the number of trees growing on the land. Each of the next lines contains the integer coordinates of one tree as two integers and separated by a space (). One unit of coordinate corresponds to exactly one metre; for example, the distance between coordinates and is one metre.
Output
Output a single integer: the number of cows that can survive on the largest pasture you can construct.