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