当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3021:Tree Fence

题目描述
XEN has a small yard. The yard is square and 1000*1000 large. The lower left corner has coordinates (0, 0), the upper right (1000, 1000). There are N trees in the yard. In order to protect them, XEN wants to fence some of them.

XEN can only select some of the M positions which are provided in advance to insert wood piles, then he built fence along the inserted wood piles. Finally, the fence will be a polygon. As the picture below (Data is in the Sample):

XEN should pay 47 yuan for each wood pile which were inserted. But he can get 173 yuan from each tree which is in the final polygon. Obviously,the income is the difference between the total money he get and the total money he pay.

Now XEN want to know the maximum income he will get. But he doesn't know how to calculate it so that he asks your perfect team for help. Can you help him?
输入解释
Your program is to read from standard input.

In the first line, there are two integer N, M (1 ≤ N, M ≤ 200), as the description means. The following lines are in the format: the former N lines are the locations of trees, the other M lines are for the M positions. In addition, there is a space between the two numbers of the same line.

Tx1 Ty1
Tx2 Ty2
...
Txn Tyn
Px1 Py1
Px2 Py2
...
PXm Pym

(0 ≤ Txi, Tyi, Pxi, Pyi ≤ 1000, Integer!)
输出解释
Output an integer, the maximum income, in one line (enter is needed).
输入样例
3 4
400 300
600 500
800 900
800 300
200 200
200 700
600 700
输出样例
205
来自杭电HDUOJ的附加信息
Recommend gaojie

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-3021

最后修改于 2020-10-25T22:59:18+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
2000/1000MS(Java/Others) 32768/32768K(Java/Others)