#P5977. [CEOI 2008] Fence
[CEOI 2008] Fence
Problem Description
In a area, there are fixed points and trees.
Now you want to build a fence to protect the trees. The cost to build it is: (the number of fixed points you choose) + (the number of trees not enclosed by the fence) .
You want this value to be as small as possible. Find the minimum cost.
Input Format
The first line gives .
The next lines give the coordinates of the fixed points.
The next lines give the coordinates of the trees.
Output Format
Output the minimum cost.
4 3
800 300
200 200
200 700
600 700
400 300
600 500
800 900
171
Hint
For of the testdata, 。
Translated by ChatGPT 5