#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long x1, x2, y1, y2, n, m, dx, dy, ans = 0, l = 0;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    dx = abs(x1 - x2);
    dy = abs(y1 - y2);
    ans = n * m - 2 * (n - dx) * (m - dy) +
          max(l, n - 2 * dx) * max(l, m - 2 * dy);
    cout << ans << endl;
  }
  return 0;
}
