Abhi Ram analyses london stock exchange and invests in a software company C-.gate . He wants to sell his shares after 5 weeks.

Given the investment  m, increase or decrease of share prices of 5 weeks(+/- pi) , help him to calculate his net profit or loss percentage(n%) of his investment to establish his own company KMC.

-----Input:-----

- The first line contains an integer T which denotes the number of test cases.
- Each test case comprises of two lines: the first line contains the integer m which denotes the amount invested.

The second line consists of five space separated integers(p1, p2, p3, p4, p5) each preceeded by + (increase) or - (decrease) which give the percentage of change in share prices over 5 weeks.
.

-----Output:-----
The output contains a single number n which gives the percentage of profit or loss preceeded by + (profit) or - (loss).

-----Constraints:-----
- 1 ≤ T ≤ 100
- 1 ≤ m ≤ 105
- -100 ≤ pi ≤ 100

-----Example:-----
Input:
2
10000
+5 -3 -2 +10 +15
6256250
-24 +22 +4 -16 +20

Output:
+26.2634
-2.79977

```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 = 'for i in range(int(input())):\n\t n = int(input())\n\t P = list(map(float, input().split()))\n\t pr = 1\n\t for p in P:\n\t\t  a = 100+p\n\t\t  pr = (pr*a)/100\n\t pr = (pr-1)*100\n\t x = 6-len(str(int(abs(pr))))\n   \t if (x==1):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.1f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.1f" % round(pr,x)))\n\t elif (x==2):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.2f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.2f" % round(pr,x)))\n\t elif (x==3):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.3f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.3f" % round(pr,x)))\n\t elif (x==4):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.4f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.4f" % round(pr,x)))\n\t elif (x==5):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.5f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.5f" % round(pr,x)))\n\t elif (x==6):\n   \t \t if (pr==0):\n   \t \t \tprint(0)\n\t\t elif (pr>0):\n\t\t \tprint("+"+str("%.6f" % round(pr,x)))\n\t\t else:\n\t\t \tprint(str("%.6f" % round(pr,x)))'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: