AT_arc215_a [ARC215A] Zombie
Description
There is a road of length $ L $ extending left and right. There are $ N $ zombies on this road, and the $ i $ -th zombie is at a distance of $ A_i $ from the left end of the road. Here, $ L $ and all $ A_i $ are even.
You have $ K $ pieces of bait for the zombies, and you can place a piece of bait at any position on the road, including both ends, at any time. However, there must never be a moment when two or more pieces of bait exist on the road simultaneously. When bait exists on the road, each zombie moves toward the bait at a speed of $ 1 $ per unit time. When one or more zombies reach the same position as the bait, the bait is eaten and disappears instantly.
When no bait exists on the road, zombies do not move. Find the maximum total amount of time bait exists on the road when the times and positions to place the bait are chosen optimally. It can be proved that the answer is an integer.
You are given $ T $ test cases; solve each one.
Input Format
The input is given from Standard Input in the following format:
> $ T $ $ \text{case}_1 $ $ \text{case}_2 $ $ \vdots $ $ \text{case}_T $
Each test case is given in the following format:
> $ N $ $ K $ $ L $ $ A_1 $ $ A_2 $ $ \ldots $ $ A_N $
Output Format
Output $ T $ lines.
The $ i $ -th line should contain the maximum total amount of time bait exists on the road for the $ i $ -th test case.
Explanation/Hint
### Sample Explanation 1
For the first test case, it is optimal to place the bait as follows.
- First, place bait at position $ 11 $ . The two zombies simultaneously reach position $ 11 $ after $ 7 $ units of time and eat the bait.
- Then, place bait at position $ 0 $ . The two zombies simultaneously reach position $ 0 $ after $ 11 $ units of time and eat the bait.
The total amount of time bait exists on the road is $ 7 + 11 = 18 $ .
### Constraints
- $ 1 \le T \le 10^5 $
- $ 1 \le N \le 2 \times 10^5 $
- $ 1 \le K \le 10^9 $
- $ 2 \le L \le 10^9 $
- $ 0 \le A_i \le L $
- $ L $ is even.
- All $ A_i $ are even.
- The sum of $ N $ over all test cases is at most $ 2 \times 10^5 $ .
- All input values are integers.