#include <bits/stdc++.h>
using namespace std;
long long cs, c, n, m, s;
int main() {
  long long x1, y1, x2, y2;
  cin >> cs;
  for (c = 0; c < cs; c++) {
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    s = 2 * (n - (x2 - x1)) * (m - (y2 - y1));
    if (n - 2 * (x2 - x1) > 0 && m - 2 * (y2 - y1) > 0)
      s -= (n - 2 * (x2 - x1)) * (m - 2 * (y2 - y1));
    cout << n * m - s << "\n";
  }
  return 0;
}
