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