#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline int sz(const T& x) {
  return (int)x.size();
}
int main() {
  cin.sync_with_stdio(false);
  cout.sync_with_stdio(false);
  int T;
  cin >> T;
  while (T--) {
    long long n, m, x1, y1, x2, y2;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    long long w = (x2 - x1 + 1);
    long long h = (y2 - y1 + 1);
    long long am = 2 * (n - w + 1) * (m - h + 1);
    x1 = w;
    y1 = h;
    x2 = (n - w + 1);
    y2 = (m - h + 1);
    if (x1 <= x2 && y1 <= y2) am -= (x2 - x1 + 1) * (y2 - y1 + 1);
    cout << (n * m - am) << "\n";
  }
  return 0;
}
