#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, x, y, xx, yy, t;
  cin >> t;
  while (t > 0) {
    cin >> n >> m >> x >> y >> xx >> yy;
    long long a = abs(x - xx);
    long long b = abs(y - yy);
    long long ans = 2 * a * b;
    if (2 * a > n || 2 * b > m) ans = ans - (2 * a - n) * (2 * b - m);
    cout << ans << endl;
    t--;
  }
  return 0;
}
