#P5977. [CEOI 2008] Fence

    ID: 6757 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 难度: 8 上传者: 标签>动态规划 DP计算几何2008CEOI(中欧)最短路凸包

[CEOI 2008] Fence

Problem Description

In a 1000×10001000 \times 1000 area, there are nn fixed points and mm 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) ×20\times 20 + (the number of trees not enclosed by the fence) ×111\times 111.

You want this value to be as small as possible. Find the minimum cost.

Input Format

The first line gives n,mn, m.

The next nn lines give the coordinates of the fixed points.

The next mm 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 100%100\% of the testdata, 3N,M1003 \le N, M \le 100

Translated by ChatGPT 5