#include <bits/stdc++.h>
using namespace std;
const int INF = INT_MAX >> 1;
const double PI = 3.1415926535897932384626433832795;
const double EPS = 1E-8;
int main() {
  int tk;
  cin >> tk;
  while (tk-- > 0) {
    int n, m, x1, y1, x2, y2;
    scanf("%d%d%d%d%d%d", &n, &m, &x1, &y1, &x2, &y2);
    long long s1 = n - abs(x1 - x2);
    long long s2 = m - abs(y1 - y2);
    long long ans = 2 * s1 * s2;
    ans -= max(0LL, s1 - (n - s1)) * max(0LL, s2 - (m - s2));
    printf("%I64d\n", n * 1LL * m - ans);
  }
  return 0;
}
