#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t, i, n, m, x1, x2, y1, y2;
  scanf("%lld", &t);
  for (i = 0; i < t; i++) {
    scanf("%lld %lld %lld %lld %lld %lld", &n, &m, &x1, &y1, &x2, &y2);
    if (abs(x1 - x2) * 2 > n || abs(y1 - y2) * 2 > m) {
      printf("%lld\n",
             n * m - 2 * ((x1 > x2 ? x2 : x1) + n - (x1 > x2 ? x1 : x2)) *
                         ((y1 > y2 ? y2 : y1) + m - (y1 > y2 ? y1 : y2)));
    } else {
      printf("%lld\n", abs(2 * (x1 - x2) * (y1 - y2)));
    }
  }
  return 0;
}
