#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, C;
  cin >> C;
  while (C--) {
    cin >> n >> m;
    long long x, y, x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x = abs(x2 - x1);
    y = abs(y2 - y1);
    long long ans = 2 * (n - x) * (m - y);
    x = n - x, y = m - y;
    if ((x << 1) > n && (y << 1) > m) ans -= ((x << 1) - n) * ((y << 1) - m);
    cout << n * m - ans << endl;
  }
}
