若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1600: Chainsaw Massacre

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,188

题目描述

The Canadian Lumberjack Society has just held its annual woodcutting competition and the national forests between Montreal and Vancouver are devastated. Now for the social part! In order to lay out an adequate dance floor for the evening party the organizing committee is looking for a large rectangular area without trees. All lumberjacks are already drunk and nobody wants to take the risk of having any of them operate a chainsaw.

The organizing committee has asked you to find the largest free rectangular region which can serve as the dance floor. The area in which you should search is also rectangular and the dance floor must be entirely located in that area. Its sides should be parallel to the borders of the area. The dance floor may be located at the borders of the area, and trees may grow on the borders of the dance floor.

输入

The first line of the input specifies the number of scenarios. For each scenario, the first line provides the length l and width w of the area in meters ( 0 < l, w<=10, 000, both integers). Each of the following lines describes either a single tree, or a line of trees according to one of the following formats:

1 x y, where the “1'' characterizes a single tree, and x and y provide its coordinates in meters with respect to the upper-left corner.
k x y dx dy, where k > 1 provides the number of trees in a line with coordinates (x, y),(x + dx, y + dy),…,(x + (k – 1)dx, y + (k – 1)dy).
0 denotes the end of the scenario.
The coordinates x, y, dx, and dy are given as integers. All the trees will be situated in this area, i.e., have coordinates in [0, l] x [0, w]. There will be at most 1,000 trees.

输出

For each scenario print a line containing the maximum size of the dance floor measured in square meters.

样例输入

2
2 3
0
10 10
2 1 1 8 0
2 1 9 8 0
0


样例输出

6
80


参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Dreams孤独患者 Skip 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist