#include <bits/stdc++.h>
int main() {
  int t;
  std::cin >> t;
  for (; t > 0; t--) {
    long long n, m, x1, y1, x2, y2;
    std::cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    long long x = ((x2 - x1 < 0) ? -(x2 - x1) : (x2 - x1));
    long long y = ((y2 - y1 < 0) ? -(y2 - y1) : (y2 - y1));
    long long dx = n - x;
    long long dy = m - y;
    long long covered = 2 * dx * dy - ((((0) > (dx - x)) ? (0) : (dx - x)) *
                                       (((0) > (dy - y)) ? (0) : (dy - y)));
    long long missed = (n * m) - covered;
    std::cout << missed << std::endl;
  }
  return 0;
}
