#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
const int inf = 1e9;
const int mod = 1e9 + 7;
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long n, m, x1, x2, y1, y2, a, b;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    a = abs(x1 - x2);
    b = abs(y1 - y2);
    long long ans = 2ll * (n - a) * (m - b);
    if ((n - a) * 2ll > n && (m - b) * 2ll > m)
      ans -= (2ll * (n - a) - n) * (2ll * (m - b) - m);
    cout << n * m - ans << '\n';
  }
}
