Problem: You are responsible for installing a gas pipeline along a road. Let's consider the road (for simplicity) as a segment on axis. The road can have several crossroads, but for simplicity, we'll denote each crossroad as an interval with integer . So we can represent the road as a binary string consisting of characters, where character 0 means that current interval doesn't contain a crossroad, and 1 means that there is a crossroad.
Usually, we can install the pipeline along the road on height of unit with supporting pillars in each integer point (so, if we are responsible for road, we must install pillars). But on crossroads we should lift the pipeline up to the height , so the pipeline won't obstruct the way for cars.
We can do so inserting several zig-zag-like lines. Each zig-zag can be represented as a segment with integer consisting of three parts: units of horizontal pipe + unit of vertical pipe + of horizontal. Note that if pipeline is currently on height , the pillars that support it should also have length equal to units.
Each unit of gas pipeline costs us bourles, and each unit of pillar — bourles. So, it's not always optimal to make the whole pipeline on the height . Find the shape of the pipeline with minimum possible cost and calculate that cost.
Note that you must start and finish the pipeline on height and, also, it's guaranteed that the first and last characters of the input string are equal to 0.
Input Format: The fist line contains one integer () — the number of queries. Next lines contain independent queries — one query per two lines.
The first line contains three integers , , (, , ) — the length of the road, the cost of one unit of the pipeline and the cost of one unit of the pillar, respectively.
The second line contains binary string (, , ) — the description of the road.
It's guaranteed that the total length of all strings doesn't exceed .
Output Format: Print integers — one per query. For each query print the minimum possible cost of the constructed pipeline.
Note: The optimal pipeline for the first query is shown at the picture above.
The optimal pipeline for the second query is pictured below:
The optimal (and the only possible) pipeline for the third query is shown below:
The optimal pipeline for the fourth query is shown below: