Unrumpf
Time limit5sMemory limit256 MB
Given the convex hull of 10 to 100 random integer points, guess how many points generated each hull.
- Level
Medium6 of 10
- Topics
- Geometry, Probability, Math
- Solved
- No attempts yet
Problem
While preparing a brute-force solution for the problem 'Rumpf', we wrote a program that repeatedly does the following. It picks a random number uniformly at random between 10 and 100. It then generates random points with integer coordinates, choosing each coordinate independently and uniformly at random from all integers between 0 and , inclusive. Finally, it finds the convex hull of those points.
You are given 10000 polygons generated by this program. For each polygon, guess the value that was used to generate it.
Input
The first line contains the number of convex hulls to process. is always equal to 10000. Each of the next lines describes one convex hull. A line starts with the number of vertices , followed by pairs of integers, which are the coordinates of the vertices. The vertices are given in counterclockwise order, and no three consecutive vertices lie on the same line.
It is guaranteed that the convex hulls were generated by the method described above.
Output
Output lines, each with one integer: your guess for the initial number of random vertices used to generate the corresponding convex hull. Each guess must be between 10 and 100, inclusive.
Your answer is accepted if the average, over all 10000 hulls, of the absolute difference between the natural logarithm of your guess and the natural logarithm of the true is below 0.2.
In the sample case, your answer is accepted if all your guesses are between 10 and 100, inclusive.
Constraints
There are 10 non-sample test cases for this problem.