Xor Sum
#描述#
Your job is to calculate ∑(S1 XOR S2 XOR … XOR Sn) mod 1000000007, where Li <= Si <= Hi, 1 <= i <= n.
<br>
<br>
for case2: we can calculate like this: (1^2)+(1^3)+(2^2)+(2^3) = 6
#格式#
##输入格式##
The first line of the input is an integer T (T <= 100), which stands for the number of test cases you need to solve.
Every test case begins with an integer n (1 <= n <= 100), and followed by n pairs of integers L1, H1, L2, H2, …,Ln, Hn (1<=Li<=Hi<=10^9, 1<=i<=n). Every pair occupies a line.
##输出格式##
For every test case, you should output "Case #k: " first, where k indicates the case number and starts at 1. Then output the answer. See sample for more details.
#样例1#
##样例输入1##
2
1
1 10
2
1 2
2 3
##样例输出1##
Case #1: 55
Case #2: 6
#限制#
1000ms
32768KB
#提示#
xor是按位异或. 一种位运算.
#来源#