You are given an array $$$a$$$ of $$$n$$$ integers. Your initial score is $$$0$$$.
You can perform the following two types of operations any number of times until the array becomes empty:
After each operation, the remaining elements are concatenated without changing their relative order.
You are also given an integer $$$c$$$, which represents the cost of performing one operation. Every time you perform an operation (regardless of the type), $$$c$$$ is subtracted from your score.
Compute the maximum possible final score you can achieve.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^4$$$). The description of the test cases follows.
The first line of each test case contains two integers $$$n$$$ and $$$c$$$ ($$$1 \le n \le 2 \cdot 10^5$$$, $$$0 \le c \le 10^9$$$), representing the length of $$$a$$$ and the cost of performing one operation, respectively.
The second line contains $$$n$$$ integers $$$a_1,a_2,\ldots,a_n$$$ ($$$-10^9 \le a_i \le 10^9$$$), representing the elements of $$$a$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
For each test case, output an integer representing the maximum possible score you can achieve.
51 0-13 01 3 13 21 3 16 63 1 4 1 5 94 1000000000-1000000000 -1000000000 -1000000000 -1000000000
-1500-4000000000
In the first test case, your only possible choice is to perform the first operation once. Your score is $$$a_1-c=-1-0=-1$$$.
In the second test case, one optimal sequence of operations is:
In the third test case, one optimal sequence of operations is: