Problem C
Roundelays
Roundelay is a game where people dance in a circle holding hands, and some people might stand in the middle of the circle. You saw kids playing this game in two groups (two roundelays). Unfortunately, you completely forgot who was holding hands with whom. The only two things you remember are that both groups (including children holding hands and in the middle) had the same number of children, and the total number of children in the middle of the two roundelays was minimal across all possible hand-holding configurations.
Each child’s position is given by a 2D coordinate in the $xy$-plane, and you can draw a line between the positions of every pair of kids holding hands such that no two lines cross each other. Each roundelay has at least three children holding hands with each other (i.e. not in the middle of the roundelay), and all these kids are facing the inside of the roundelay. When holding hands, their arms make an angle of less than $180^{\circ }$ in the direction they are facing. Your task is to find out the number of children who were in the middle of the two roundelays.
For example, in the figure above, there are $10$ children with coordinates $(1, 1)$, $(-1, -1)$, $(-1, 1)$, $(1, -1)$, $(0, -0.5)$, $(4, 3)$, $(4, 5)$, $(6, 3)$, $(6, 5)$, $(5, 4.5)$. For this set of coordinates, the minimum number of children in the middle of the roundelays is $2$. One way to achieve this is by the configuration shown in the picture.
Note that, in general, roundelays do not have to be squares like in the above example. They can be any shape that satisfies the requirements in the problem statement (that is, they can be any convex polygon). Moreover, it is possible for a roundelay to have no children in the middle of it.
Input
The input starts with one line containing an even integer $N$ ($6 \leq N \leq 400$), the number of children.
This is followed by $N$ lines, each containing two space-separated real numbers $x_ i$, $y_ i$ ($0 \leq \left|x_ i\right|, \left|y_ i\right| \leq 10^5$), where $(x_ i, y_ i)$ represents the coordinates of the $i$-th child.
It is guaranteed that no two children have the same coordinates, and no line through two children passes within $10^{-6}$ of another child. It is also guaranteed that the two roundelays did not overlap, and neither roundelay was completely inside the other.
Output
Output one line containing a single integer $m$, the minimum number of children in the middle of the two roundelays across all possible hand-holding configurations.
Sample Input 1 | Sample Output 1 |
---|---|
10 1 1 -1 -1 -1 1 1 -1 0 -0.5 4 3 4 5 6 3 6 5 5 4.5 |
2 |
Sample Input 2 | Sample Output 2 |
---|---|
6 0 0 0 2 2 0 -1 2 -1 -2 4 4 |
0 |