#include <bits/stdc++.h>
using namespace std;
int main() {
  int T, n, m, x1, y1, x2, y2;
  cin >> T;
  while (T--) {
    scanf("%d %d %d %d %d %d", &n, &m, &x1, &y1, &x2, &y2);
    long long ans = 0;
    int x = abs(x1 - x2);
    int y = abs(y1 - y2);
    ans = 1ll * x * y * 2;
    if (2 * x > n && 2 * y > m) ans -= 1ll * (2 * x - n) * (2 * y - m);
    if (2 * y > m && 2 * x < n) ans += 1ll * (2 * y - m) * (n - 2 * x);
    if (2 * x > n && 2 * y < m) ans += 1ll * (2 * x - n) * (m - 2 * y);
    cout << ans << endl;
  }
}
