http://codeforces.com/contest/1248/problem/A
注意开大数
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ios::sync_with_stdio(false);
ll t;
for(cin >> t;t--;)
{
ll n, x;
ll a1, a2, b1, b2;
a1 = a2 = b1 = b2 = 0;
for(cin >> n; n-- && cin >> x;)
if(x & 1)
a1++;
else
a2++;
for(cin >> n ; n-- && cin >> x;)
if(x & 1)
b1++;
else
b2++;
cout << a1 * b1 + a2 * b2<< endl;
}
return 0;
}