#include <bits/stdc++.h>
using namespace std;
long long n, m, x111, y111, x2, y2;
int main() {
  int Q;
  cin >> Q;
  while (Q-- > 0) {
    cin >> n >> m >> x111 >> y111 >> x2 >> y2;
    long long lx = max(1 - x111, 1 - x2), rx = min(n - x111, n - x2),
              ly = max(1 - y111, 1 - y2), ry = min(m - y111, m - y2);
    long long OBR = 2 * (rx - lx + 1) * (ry - ly + 1);
    long long sx = max(x111 + lx, x2 + lx), ex = min(x111 + rx, x2 + rx),
              sy = max(y111 + ly, y2 + ly), ey = min(y111 + ry, y2 + ry);
    if (sx <= ex && sy <= ey) OBR -= (ex - sx + 1) * (ey - sy + 1);
    cout << n * m - OBR << '\n';
  }
  return 0;
}
