编程介的小学生 2019-06-03 11:24 采纳率: 20.5%
浏览 117

围栏的收益面积的问题,怎么使用C语言的程序代码编写的过程方式去解决的,具体的代码

Problem Description
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?

Input
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
Output an integer, the maximum income, in one line (enter is needed).

Sample Input
3 4
400 300
600 500
800 900
800 300
200 200
200 700
600 700

Sample Output
205

  • 写回答

0条回答

    报告相同问题?

    悬赏问题

    • ¥15 聚类分析或者python进行数据分析
    • ¥15 如何用visual studio code实现html页面
    • ¥15 逻辑谓词和消解原理的运用
    • ¥15 三菱伺服电机按启动按钮有使能但不动作
    • ¥15 js,页面2返回页面1时定位进入的设备
    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?