编程介的小学生 2017-04-05 16:17 采纳率: 20.5%
浏览 960
已采纳

Overlapping Objects

There are many objects in space with possible overlapping with each other. The space may have arbitary dimension. A one-dimension object is a segment; A two-dimension object is a rectangle; A three-dimension object is a cube, etc.
Given a set of such objects, you will have to calculate the overlapping region of them.

Input

Input contains multiple tests. Each test starts with two integers, m (0 < m <= 10, the dimension of the case) and n (0 < n <= 3, the number of objects). A test with m = 0 and n = 0 indicates the end of input. This test is not to be processed.

The following n lines contain 2m integers each, in the form x1 x2 (-10000 <= x1 < x2 <= 10000) y1 y2 ...

Output

For each case output several lines in the form: num area, where num is the number of objects and area is the total length, area, volumn, etc. of overlapping region of num objects. The entries are sorted in ascending order and entries with area of 0 is omitted.

Sample Input

1 1
0 1
2 2
0 2 0 2
1 3 1 3
0 0

Sample Output

1 1
1 6
2 1

  • 写回答

1条回答 默认 最新

报告相同问题?

悬赏问题

  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能
  • ¥15 jmeter脚本回放有的是对的有的是错的
  • ¥15 r语言蛋白组学相关问题