Given an array $$$a$$$ of length $$$n$$$ and constants $$$A$$$, $$$B$$$, $$$C$$$, $$$D$$$.
Let's define the $$$mix$$$ value of an array $$$b_1, b_2, \ldots, b_k$$$ as $$$A \cdot \max(b) + B \cdot \min(b) + C \cdot \text{mex}(b) + D$$$, where:
Let's define the $$$mix$$$ value of splitting an array into blocks as the sum of the $$$mix$$$ values of the blocks.
Find the maximum possible $$$mix$$$ value of splitting.
The first line contains one integer $$$T$$$ — the number of test cases.
The first line of each test case contains one integer $$$n$$$ $$$(1 \le n \le 2 \times 10^5)$$$ — length of the array.
The second line contains four integers $$$A, B, C, D$$$ $$$(-10^5 \le A, B, C, D \le 10^5)$$$ — constants for $$$mix$$$ value.
The third line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ $$$(0 \le a_i \le n)$$$ — elements of the array.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \times 10^5$$$.
For each test case, output the maximum possible $$$mix$$$ value of splitting.
410-1 0 -1 12 4 2 3 0 0 0 1 7 3101 1 0 -16 0 1 1 5 1 1 6 2 1100 -2 -3 16 3 0 1 4 0 6 9 7 3101 1 -1 02 4 3 2 1 6 4 0 1 0
-9 38 -5 44
Splitting of an array is dividing an array into some number of blocks. Every element in the array should be included in exactly one block. Each block should be a contiguous subarray. For example, $$$[1, 2], [3], [4, 5]$$$ is a splitting of the array $$$[1, 2, 3, 4, 5]$$$, and $$$[1, 2], [2]$$$ is not a splitting of the array $$$[2, 2, 1]$$$.
| Name |
|---|


