Chef has come to a 2 dimensional garden in which there are N points. Each point has coordinates (x, y), where x can either be 1 or 2 or 3. Chef will now choose every triplet of these N points and make a triangle from it. You need to tell the sum of areas of all the triangles the Chef makes.
Note that some of the triplets might not form proper triangles, and would end up as a line or a point (ie. degenerate), but that is fine because their area will be zero.

-----Input-----
- The first line contains a single integer T, the number of test cases. The description of each testcase follows.
- The first line of each test case contains an integer N denoting the number of points on the plane.
- The next N lines contain 2 space separated integers x and y denoting the coordinates of the points. 

-----Output-----
For each test case, output a single line containing the answer. Your answer will be considered correct if the absolute error is less than or equal to 10-2.

-----Constraints-----
- 1 ≤ T ≤ 20
- 1 ≤ N ≤ 2000
- 1 ≤ x ≤ 3
- 1 ≤ y ≤106
- All (x, y) pairs are distinct

-----Example-----
Input:
2
3
1 1
2 1
3 3
4
1 1
2 2
2 1
3 3

Output:
1.0
2.0

-----Explanation:-----
Test Case 1: There is only one triangle which has non-zero area, and it's area is 1, hence the output.
Test Case 2: Let the points be A(1,1), B(2,2), C(2,1), D(3,3). There are 3 non degenerate triangles possible. 

-  area ABC = 0.5
-  area BCD = 0.5
-  area ACD = 1
Total area = 2

```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 = "# Author: Dancing Monkey | Created: 09.DEC.2018\n\n\nimport bisect\nfor _ in range(int(input())):\n n = int(input())\n x1 , x2, x3 = [], [], []\n for i in range(n):\n  x, y = list(map(int, input().split()))\n\n  if x == 1: x1.append(y)\n  if x == 2: x2.append(y)\n  if x == 3: x3.append(y)\n\n x1.sort()\n x2.sort()\n x3.sort()\n\n y1, y2, y3 = len(x1), len(x2), len(x3)\n area = 0\n for i in range(y1):\n  for j in range(i+1, y1):\n   area += abs(x1[i] - x1[j])*(y2 + (2*y3))\n\n for i in range(y3):\n  for j in range(i+1, y3):\n   area += abs(x3[i] - x3[j])*(y2 + (2*y1))\n\n for i in range(y2):\n  for j in range(i+1, y2):\n   area += abs(x2[i] - x2[j])*(y1 + y3)\n\n area /= 2\n\n s1 = [0]\n for i in range(y2): s1.append(s1[-1] + x2[i])\n # print(s1)\n s2 = [0]\n for i in range(y2):s2.append(s2[-1] + x2[y2 - 1 - i])\n # print(s2)\n\n for i in x1:\n  for j in x3:\n   p1 = (i + j) / 2\n   p = bisect.bisect_left(x2, p1)\n   # print('p', p)\n   l = p\n   h = y2 - l\n   # print(l, h)\n\n   area += p1*(l) - s1[l]\n   # print('dfg', area)\n   area += s2[h] - p1*(h)\n\n print(format(area, 'f'))\n # print()\n"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14197