#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t, n, m, x1, x2, y1, y2, ans, melt, X, Y;
  cin >> t;
  while (t--) {
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    X = abs(x2 - x1);
    Y = abs(y2 - y1);
    melt = 2 * ((n - X) * (m - Y));
    if (2 * (n - X) > n && 2 * (m - Y) > m)
      melt -= (2 * (n - X) - n) * (2 * (m - Y) - m);
    ans = n * m - melt;
    cout << ans << "\n";
  }
  return 0;
}
