Bertown is a city with $n$ buildings in a straight line.

The city's security service discovered that some buildings were mined. A map was compiled, which is a string of length $n$, where the $i$-th character is "1" if there is a mine under the building number $i$ and "0" otherwise.

Bertown's best sapper knows how to activate mines so that the buildings above them are not damaged. When a mine under the building numbered $x$ is activated, it explodes and activates two adjacent mines under the buildings numbered $x-1$ and $x+1$ (if there were no mines under the building, then nothing happens). Thus, it is enough to activate any one mine on a continuous segment of mines to activate all the mines of this segment. For manual activation of one mine, the sapper takes $a$ coins. He can repeat this operation as many times as you want.

Also, a sapper can place a mine under a building if it wasn't there. For such an operation, he takes $b$ coins. He can also repeat this operation as many times as you want.

The sapper can carry out operations in any order.

You want to blow up all the mines in the city to make it safe. Find the minimum number of coins that the sapper will have to pay so that after his actions there are no mines left in the city.


-----Input-----

The first line contains one positive integer $t$ ($1 \le t \le 10^5$) — the number of test cases. Then $t$ test cases follow.

Each test case begins with a line containing two integers $a$ and $b$ ($1 \le a, b \le 1000$) — the cost of activating and placing one mine, respectively.

The next line contains a map of mines in the city — a string consisting of zeros and ones.

The sum of the string lengths for all test cases does not exceed $10^5$.


-----Output-----

For each test case, output one integer — the minimum number of coins that the sapper will have to pay.


-----Example-----
Input
2
1 1
01000010
5 1
01101110

Output
2
6



-----Note-----

In the second test case, if we place a mine under the fourth building and then activate it, then all mines on the field are activated. The cost of such operations is six, $b=1$ coin for placing a mine and $a=5$ coins for activating.

```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 = 'import sys\nimport math\ndef II():\n\treturn int(sys.stdin.readline())\n \ndef LI():\n\treturn list(map(int, sys.stdin.readline().split()))\n \ndef MI():\n\treturn list(map(int, sys.stdin.readline().split()))\n \ndef SI():\n\treturn sys.stdin.readline().strip()\nt = II()\nfor q in range(t):\n\ta,b = MI()\n\ts = list(SI())\n\tx = []\n\ty = []\n\tcount = 1\n\tfor i in range(1,len(s)):\n\t\tif s[i] == s[i-1]:\n\t\t\tcount+=1\n\t\telse:\n\t\t\tif s[i-1] == "0":\n\t\t\t\ty.append(0)\n\t\t\telse:\n\t\t\t\ty.append(1)\n\t\t\tx.append(count)\n\t\t\tcount = 1\n\tif len(s)!=0 and s[-1] == "1":\n\t\ty.append(1)\n\t\tx.append(count)\n\tif len(y)!=0 and y[0] == 0:\n\t\ty.pop(0)\n\t\tx.pop(0)\n\ty1 = []\n\tans = 0\n\tfor i in range(len(y)):\n\t\tif y[i] == 0:\n\t\t\ty1.append(x[i])\n\t\telse:\n\t\t\tans+=a\n\tfor i in y1:\n\t\tif i*b<a:\n\t\t\tans-=a\n\t\t\tans+=i*b\n\tprint(ans)\n'
_co = compile(_CODE, USER_FILENAME, "exec")
exec(_co, ns, ns)

```

Measured memory_bytes: 14595