#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < (t); i++) {
    int n, m, x1, y1, x2, y2;
    scanf("%d %d %d %d %d %d", &n, &m, &x1, &y1, &x2, &y2);
    if (x1 > x2) swap(x1, x2);
    if (y1 > y2) swap(y1, y2);
    x2 = x2 - x1 + 1;
    y2 = y2 - y1 + 1;
    long long ans = n;
    ans *= m;
    long long cur = n - x2 + 1;
    cur *= m - y2 + 1;
    cur *= 2;
    if (2 * (n - x2 + 1) > n && 2 * (m - y2 + 1) > m) {
      long long diff = 2 * (n - x2 + 1) - n;
      diff *= 2 * (m - y2 + 1) - m;
      cur -= diff;
    }
    cout << ans - cur << endl;
  }
  return 0;
}
