2014
11-05

# Jesus of Suburbia

Lines are of single-dimension.
Surfaces are of double-dimension.
Cubes are of triple-dimension.
Jesus is of four-dimension.

Jesus told you that: I do not want to stay in the four-dimensional space but N-dimensional space instead. However, I do not know what the N-dimensional space is like, and therefore I need your help. I want to know the Union of the (length or area or volume, etc) of M N-dimensional object. You have to calculate the number.

There are several test cases in the input.

The first line includes two positive integer M and N (1 ≤ N ≤ 10, 1 ≤ M ≤ 100) indicating there are M N-dimensional objects.
The following 2M lines describe M N-dimensional objects.
For each subject, there are two lines:
The first line contains N integers describing a corner.
The second line contains N integers describing the opposite corner.
You can assume all coordinates are no more than 10^9.

The input terminates by end of file marker.

There are several test cases in the input.

The first line includes two positive integer M and N (1 ≤ N ≤ 10, 1 ≤ M ≤ 100) indicating there are M N-dimensional objects.
The following 2M lines describe M N-dimensional objects.
For each subject, there are two lines:
The first line contains N integers describing a corner.
The second line contains N integers describing the opposite corner.
You can assume all coordinates are no more than 10^9.

The input terminates by end of file marker.

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

44

HintHappy birthday to DaoThree! 

1. 其实国内大部分公司对算法都不够重视。特别是中小型公司老板根本都不懂技术，也不懂什么是算法，从而也不要求程序员懂什么算法，做程序从来不考虑性能问题，只要页面能显示出来就是好程序，这是国内的现状，很无奈。

2. 博主您好，这是一个内容十分优秀的博客，而且界面也非常漂亮。但是为什么博客的响应速度这么慢，虽然博客的主机在国外，但是我开启VPN还是经常响应很久，再者打开某些页面经常会出现数据库连接出错的提示

3. I like your publish. It is great to see you verbalize from the coronary heart and clarity on this essential subject matter can be easily noticed.

4. 代码是给出了，但是解析的也太不清晰了吧！如 13 abejkcfghid jkebfghicda
第一步拆分为 三部分 (bejk, cfghi, d) * C(13,3)，为什么要这样拆分，原则是什么？

5. Often We don’t set up on weblogs, but I would like to condition that this established up really forced me individually to do this! considerably outstanding publish