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

建议使用的浏览器:

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

1899:Farmer Bill's Problem

题目描述
It is rumored that the planet Earth is often visited by Unidentified Flying Objects (UFOs). Sometimes UFOs land and leave burned out regions. Observations show that these regions have the form of circles.

Recently farmer Bill has found such circles on his nice rectangular wheat field. Bill likes all mysterious things very much, so he has decided to keep these circles on the field. However, although being an ufolog, first of all Bill is the farmer, so he needs to harvest his wheat. Therefore he has decided to keep some regions containing circles intact, and harvest the rest of the field.

All regions that Bill keeps unharvested must be rectangles that neither touch nor overlap each other. The sides of the rectangles must be parallel to the sides of the field. All circles left by UFOs must be inside these regions. The total area of the regions must be minimal possible, so that Bill could harvest the maximal possible part of his field.

Now Bill wants to know the total area of the field that he will be able to harvest. Help him!
输入解释
The first line of the input contains two integer numbers x and y -- the dimensions of Bill's field (1 <= x, y <= 1000). Let Bill's field be positioned on the plane in such a way that its corners are located in points with coordinates (0, 0), (x, 0), (x, y) and (0, y). The second line of the case contains N -- the number of circles left by UFOs on Bill's field (0 <= N <= 100). Next N lines describe circles: each line contains three positive integer numbers xi, yi and ri -- coordinates of the center and radius of the circle. Circles may touch, overlap or contain each other. All circles are completely located within the field bounds.
输出解释
Output a single integer number — the area of the part of the field that Bill will be able to harvest.
输入样例
10 8
2
3 3 1
1 1 1
输出样例
64

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-1899

最后修改于 2020-10-29T06:17:09+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 30000