During Quarantine Time Chef is at home and he was quite confused about what to cook so, he went to his son and asked about what would he prefer to have? He replied, cakes.
Now, chef cook $N$ number of cake and number of layers for every cake is different. After cakes are baked, Chef arranged them in a particular order and then generates a number by putting number of layers of cakes as digit in sequence (e.g., if chef arranges cakes with layers in sequence $2$, $3$ and $5$ then generated number is $235$).
Chef has to make his son powerful in mathematics, so he called his son and ask him to arrange the cakes in all the possible ways and every time when different sequence is generated he has to note down the number. At the end he has to find sum of all the generated numbers. So, help him to complete this task.

-----Input:-----
- First line will contain $T$, number of testcases. Then the testcases follow. 
- The first line of each test case contains a single integer $N$ denoting number of cakes.
- The second line contains $N$ space-separated integers $L1$ $L2$ … $LN$ layers of the cake.

-----Output:-----
For each test case, print a single line containing sum of all the possible numbers which is generated by arranging cake in different sequence.

-----Constraints :-----
- $1 \leq T  \leq 2*10^5$
- $1 \leq N, L1, L2, L3,…, LN \leq 9$

-----Sample Input:-----
1
3
2 3 5

-----Sample Output:-----
2220

-----Explanation:-----
Sum of all possibilities :
$235 + 532 + 253 + 352 + 523 + 325 = 2220 $

```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 = "try:\r\n    import math\r\n    def getSum(arr, n): \r\n    \r\n        # calculate factorial \r\n        fact = math.factorial(n) \r\n    \r\n        digitsum = 0\r\n        for i in range(n): \r\n            digitsum += arr[i] \r\n        digitsum *= (fact // n) \r\n    \r\n        # Compute result (sum of  \r\n        # all the numbers) \r\n        res = 0\r\n        i = 1\r\n        k = 1\r\n        while i <= n : \r\n            res += (k * digitsum) \r\n            k = k * 10\r\n            i += 1\r\n    \r\n        return res \r\n    \r\n    \r\n    b=int(input())\r\n    \r\n    ls=[]\r\n    \r\n    while(b>0):\r\n        a = int(input())\r\n        \r\n        arr = input()   # takes the whole line of n numbers\r\n        l = list(map(int,arr.split(' ')))\r\n    \r\n    \r\n    # n distinct digits \r\n        b-=1\r\n        n = len(l) \r\n        n=a\r\n        \r\n    \r\n        g=int(getSum(l, n))\r\n        ls.append(g)\r\n    for i in ls:\r\n        print(i)\r\nexcept:\r\n    pass"
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13279