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 = '#cook your recipe\nfrom math import factorial\ntest_cases = int(input())\nfor _ in range(test_cases):\n   n = int(input())\n   sum1 = 0\n   final_sum = 0\n   num = list(map(int, input().split()))\n   rep_time = factorial(n - 1)\n   rep_count = dict()\n   for i in num:\n      if i in rep_count:\n         rep_count[i] +=1\n      else:\n         rep_count[i] =1\n   for j in rep_count:\n      if rep_count[j] ==1:\n         sum1 +=  j * factorial(n - rep_count[j])\n      else:\n         sum1 +=  j * factorial(n-1)/ factorial(n - rep_count[j])\n   \n   for k in range(n):\n      final_sum += sum1 * (10**k)\n\n   print(int(final_sum))'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 13339