#include<bits/stdc++.h>
using namespace std;

int main ()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int T, x1, y1, x2, y2, A, B;
    cin >> T;
    for(int i = 0; i < T; i++)
    {
        cin >> x1 >> y1 >> x2 >> y2 >> A >> B;

        if(A - abs(x1 - x2) + 1 <= 0 or B - abs(y1 - y2) + 1 <= 0)
        {
            cout << 0 << endl;
        }
        else
        {
            if(x1 == x2 or y1 == y2)
            {
                if(x1 == x2)
                {
                    cout << (A + 2) * (B - abs(y1 - y2) + 1) << endl;
                }
                else
                {
                    cout << (A - abs(x1 - x2) + 1) * (B + 2) << endl;
                }
            }
            else
            {
                cout << (A - abs(x1 - x2) + 1) * (B - abs(y1 - y2) + 1) << endl;
            }
        }
    }
    return 0;
}
