Intersection
题号:NC52862
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has two sets of integers and .
He says that (or ) if and only if there exists a subset of A (or B) whose exclusive-or sum equals to x.
Bobo would like to know the number of x where and hold simultaneously.

输入描述:

The input contains zero or more test cases and is terminated by end-of-file. For each test case:
The first line contains an integer n.
The second line contains n integers .
The third line contains n integers .

*
*
* The number of test cases does not exceed 5000.

输出描述:

For each case, output an integer which denotes the result.
示例1

输入

复制
2
0 0
0 0
2
1 2
1 3

输出

复制
1
4

备注:

For the second sample, .