Under construction

Still being built. Things may change

Unrumpf

Time limit5sMemory limit256 MB

Summary
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 nin_i uniformly at random between 10 and 100. It then generates nin_i random points with integer coordinates, choosing each coordinate independently and uniformly at random from all integers between 0 and 10910^9, 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 nin_i that was used to generate it.

Input

The first line contains the number kk of convex hulls to process. kk is always equal to 10000. Each of the next kk lines describes one convex hull. A line starts with the number of vertices mim_i, followed by mim_i 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 kk lines, each with one integer: your guess for the initial number nin_i 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 nin_i 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.

Examples1

  1. Example 1

    Input
    1
    3
    0 0
    1 0
    0 1
    
    Expected output
    10