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