Chef got in the trouble! He is the king of Chefland and Chessland. There is one queen in Chefland and one queen in Chessland and they both want a relationship with him. Chef is standing before a difficult choice…
Chessland may be considered a chessboard with $N$ rows (numbered $1$ through $N$) and $M$ columns (numbered $1$ through $M$). Let's denote a unit square in row $r$ and column $c$ by $(r, c)$. Chef lives at square $(X, Y)$ of this chessboard.
Currently, both queens are living in Chessland too. Each queen, when alone on the chessboard, can see all squares that lie on the same row, column or diagonal as itself. A queen from $(x_q, y_q)$ cannot see a square $(r, c)$ if the square $(X, Y)$ is strictly between them. Of course, if the queens can see each other, the kingdom will soon be in chaos!
Help Chef calculate the number of possible configurations of the queens such that the kingdom will not be in chaos. A configuration is an unordered pair of distinct squares $(x_{q1}, y_{q1})$ and $(x_{q2}, y_{q2})$ such that neither of them is the square $(X, Y)$. Two configurations are different if the position of queen $1$ is different or the position of queen $2$ is different.

-----Input-----
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows.
- The first and only line of each test case contains four space-separated integers $N$, $M$, $X$ and $Y$. 

-----Output-----
For each test case, print a single line containing one integer — the number of configurations such that the kingdom will not be in chaos.

-----Constraints-----
- $1 \le T \le 1000$
- $1 \le X \le N \le 10^2$
- $1 \le Y \le M \le 10^2$
- $2 \le N, M$

-----Example Input-----
2
3 3 2 2
4 4 2 3

-----Example Output-----
24
94

-----Explanation-----
Example case 1: Half of these configurations are:
- $(1, 1), (3, 3)$
- $(1, 1), (2, 3)$
- $(1, 1), (3, 2)$
- $(1, 2), (3, 3)$
- $(1, 2), (3, 2)$
- $(1, 2), (3, 1)$
- $(1, 3), (3, 1)$
- $(1, 3), (3, 2)$
- $(1, 3), (2, 1)$
- $(2, 1), (2, 3)$
- $(2, 1), (1, 3)$
- $(2, 1), (3, 3)$

```python

USER_FILENAME = "<user_code>"
import sys, json, builtins
import math, heapq, bisect, itertools, functools, collections, statistics, fractions, decimal, operator, array, random, re, string, os, pathlib
try:
    import resource as _res
except Exception:
    _res = None
from collections import Counter, defaultdict, deque, OrderedDict
from functools import lru_cache, reduce
from itertools import accumulate, permutations, combinations, product
from math import gcd, ceil, floor, sqrt
from decimal import Decimal
try:
    from typing import *
except Exception:
    pass
try:
    sys.setrecursionlimit(1_000_000)
except Exception:
    pass
try:
    import site as _site
    try:
        _sys_sites = _site.getsitepackages() if hasattr(_site, "getsitepackages") else []
        for _p in _sys_sites:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
    try:
        _usp = _site.getusersitepackages()
        if isinstance(_usp, str):
            _usp = [_usp]
        for _p in _usp:
            if _p and _p not in sys.path:
                sys.path.append(_p)
    except Exception:
        pass
except Exception:
    pass

ns = {"__name__": "__main__"}
for _k, _v in list(globals().items()):
    if not _k.startswith("_"):
        ns[_k] = _v
_CODE = 'def C(n):\n return n*(n-1)//2\n\n\ndef sol():\n equal, mini = False, min(N,M)\n total_ways = 2*C(N * M)\n if N==M:\n  equal = True\n ways = 0\n if not equal:\n  ways = (N*C(M)+M*C(N))\n  diag = 0\n  for i in range(2, mini+1):\n   diag += 2*C(i)\n  for i in range(mini+1,max(N,M)):\n   diag += C(mini)\n  diag *= 2\n  ways += diag\n  ways *= 2\n else:\n  ways = (N*C(M)+M*C(N))\n  diag = 0\n  for i in range(2, mini):\n   diag += 2*C(i)\n  diag += C(mini)\n  diag *= 2\n  ways += diag\n  ways *=2\n safe = total_ways - ways\n l, r, t, d = Y-1, M-Y, X-1, N-X\n safe_add, to_remove = 0, 0\n\n for i in range(1,N+1):\n  for j in range(1, M+1):\n   if i==X or j==Y or abs(i-X)==abs(j-Y):\n    continue\n   else:\n    to_remove += 1\n\n if l>0 and r>0 and t>0 and d>0:\n  dtl, dtr, dbl, dbr = min(l,t), min(r,t), min(l,d), min(r,d)\n  safe_add += dtl*dbr*2 + dtr*dbl*2\n  safe_add += t*d*2\n  safe_add += l*r*2\n elif l>0 and r>0:\n  safe_add += l*r*2\n elif t>0 and d>0:\n  safe_add += t*d*2\n\n safe += safe_add - to_remove*2\n\n return safe\n\n\nT = int(input())\nfor _ in range(T):\n N, M, X, Y = [int(x) for x in input().split()]\n print(sol())'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13221