#include <iostream>

using namespace std;

int main () {
    int x, y, x1, y1, a, b, c = 0, res = 0;
    int n;
    cin >> n;
    for ( int j = 0; j < n; j ++ ) {
        cin >> x >> y >> x1 >> y1 >> a >> b;
        c = 0;
        for ( int i = 0; i <= a; i ++ ) {
            for ( int m = 0; m <= b; m ++ ) {
                if ( i + (x1 - x) <= a && m + (y1 - y) <= b )  c++;
            }
        }
        cout << c << endl;
    }
    return 0;
}
