#include <bits/stdc++.h>
using namespace std;
int t;
long long n, m, xx1, xx2, yy1, yy2;
int main() {
  cin >> t;
  for (int i = 0; i < t; ++i) {
    cin >> n >> m >> xx1 >> yy1 >> xx2 >> yy2;
    long long res = n * m;
    long long k1 = n - max(xx1, xx2);
    long long k2 = min(xx1, xx2);
    long long k3 = m - max(yy1, yy2);
    long long k4 = min(yy1, yy2);
    res -= 2 * ((k1 + k2) * (k3 + k4));
    if (2 * (k1 + k2) > n && 2 * (k3 + k4) > m) {
      long long num1 = abs(2 * ((int)k1 + (int)k2) - (int)n);
      long long num2 = abs(2 * ((int)k3 + (int)k4) - (int)m);
      res += num1 * num2;
    }
    cout << res << endl;
  }
  return 0;
}
