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 = "\ndef solve(N,M,x,y):\n n,m=min(N,M),max(N,M)\n\n count = ((n-1)*n*(2*n-1)//3 + (m-n+1)*n**2 ) * 2 ## total sum of l_d and \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0r_d at all places\n p1,p2 = min(x-1,y-1),min(N-x,M-y)\n r1,r2 = min(M-y,x-1),min(N-x,y-1)\n #print('-->',p1,p2,r1,r2)\n count += (n+m)*n*m ## total sum of places queen 2 cannt have at all cells \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0including kings cell\n #print('1',count)\n\n count -= p1+p2+r1+r2 + n+m + 2 ## place occupied by king cannot be \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0occupied by queen\n #print('2',count)\n \n count += (n*m)-(p1+p2+r1+r2 + n + m -1) ##  total count where queen 2 cannot \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0come\n #print('3',count)\n\n count -= (n*m-1)*3 ## total count where queen 2 cannot come where centre is \xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0counted once\n #print('4',count)\n tot = (n*m-1)*n*m - count\n #print(tot)\n tot += 2*(p1*p2 + r1*r2 + (x-1)*(N-x) + (y-1)*(M-y))\n\n return tot\n \n\nfor _ in range(int(input())):\n\n n,m,x,y = list(map(int,input().split()))\n print(solve(n,m,x,y))\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13117