#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  long long n, m, x1, x2, y1, y2, x, y, sum;
  cin >> t;
  while (t--) {
    cin >> n >> m >> x1 >> y1 >> x2 >> y2;
    x = x1 - x2;
    y = y1 - y2;
    if (x < 0) x = -x;
    if (y < 0) y = -y;
    sum = n * m - (n - x) * (m - y) * 2;
    x = n - 2 * x;
    y = m - 2 * y;
    if (x > 0 && y > 0) sum += x * y;
    cout << sum << endl;
  }
  return 0;
}
