#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long t, n, m, x1, x2, y1, y2;
  cin >> t;
  while (t--) {
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    long long dx = abs(x2 - x1) + 1, dy = abs(y2 - y1) + 1;
    long long nx = n - dx + 1, my = m - dy + 1;
    long long max_val = nx * my;
    long long res = 0;
    res += max_val * 2;
    if (nx >= dx && my >= dy) {
      res -= (nx - dx + 1) * (my - dy + 1);
    }
    cout << n * m - res << '\n';
  }
  return 0;
}
