#include <bits/stdc++.h>
using namespace std;
inline long long mabs(long long a) { return (a < 0) ? -a : a; }
int main() {
  long long t;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    long long x1, y1, x2, y2;
    long long m, n;
    cin >> n >> m;
    cin >> x1 >> y1 >> x2 >> y2;
    if (y1 > y2) {
      swap(y1, y2);
    }
    if (x1 > x2) {
      swap(x1, x2);
    }
    long long mx1 = n - mabs(x2 - x1);
    long long my1 = m - mabs(y2 - y1);
    long long mx2 = mabs(x2 - x1);
    long long my2 = mabs(y2 - y1);
    long long ox = 0, oy = 0;
    if (mx1 > n / 2) {
      ox = mabs(mx2 - mx1);
    }
    if (my1 > m / 2) {
      oy = mabs(my2 - my1);
    }
    cout << m * n - (mx1 * my1 * 2 - ox * oy) << endl;
  }
  return 0;
}
