#include <bits/stdc++.h>
using namespace std;
long long n;
long long read() {
  long long x;
  scanf("%lld", &x);
  return x;
}
signed main() {
  long long T = read();
  while (T--) {
    long long n = read(), m = read();
    long long k1 = n * m;
    long long x1 = read(), y1_ = read(), x2 = read(), y2 = read();
    long long x = abs(x1 - x2);
    long long y = abs(y1_ - y2);
    long long t1 = n - x;
    long long t2 = m - y;
    long long k2 = t1 * t2;
    t1 = n - 2 * x;
    t2 = m - 2 * y;
    long long k3 = t1 * t2;
    if (t1 < 0 || t2 < 0) k3 = 0;
    cout << k1 - k2 * 2 + k3 << endl;
  }
  return 0;
}
