#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  cin >> t;
  for (long long i = 1; i <= t; i++) {
    long long n, m, x1, y1, x2, y2, x3, y3, x4, y4;
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    x3 = n - abs(x1 - x2);
    y3 = m - abs(y1 - y2);
    x4 = abs(x1 - x2);
    y4 = abs(y1 - y2);
    cout << n * m - x3 * y3 * 2 + max(0LL, x3 - x4) * max(0LL, y3 - y4) << '\n';
  }
  return 0;
}
