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