#P5977. [CEOI 2008] Fence

[CEOI 2008] Fence

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