#include <bits/stdc++.h>
using namespace std;
long long Max(long long a, long long b) { return a > b ? a : b; }
long long Abs(long long a) { return a > 0 ? a : -a; }
int main() {
  ios::sync_with_stdio(false);
  int t;
  cin >> t;
  while (t--) {
    long long m, n, x1, y1, x2, y2;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    x1 = Abs(x1 - x2);
    y1 = Abs(y1 - y2);
    cout << m * n - 2 * (n - x1) * (m - y1) +
                Max(n - 2 * x1, (long long)0) * Max(m - 2 * y1, (long long)0)
         << endl;
  }
}
