#include <bits/stdc++.h>
using namespace std;
long long t, n, m, x1, y11, x2, y2, x, y, p;
int main() {
  cin >> t;
  while (t--) {
    cin >> n >> m >> x1 >> y11 >> x2 >> y2;
    x = abs(x1 - x2);
    y = abs(y11 - y2);
    x1 = n - x;
    y11 = m - y;
    x2 = n - x1 + 1;
    y2 = m - y11 + 1;
    p = n * m - 2 * x1 * y11;
    if (x2 <= x1 && y2 <= y11) p += (x1 - x2 + 1) * (y11 - y2 + 1);
    cout << p << endl;
  }
  return 0;
}
