Given array $b$ of size $m$, sorted array $x$ of size $n$, and array $c$ of size $n$. You need to select a subset of indices $i_1 < i_2 < \dots < i_k$.
**Task**: Maximize the cost function:
$$Cost = \sum_{j=2}^{k} f(x_{i_j} - x_{i_{j-1}}) + \sum_{j=1}^{k} c_{i_j}$$
where $f(v) = \sum_{p=1}^{m} |v - b_p|$.
#### Input
- First line: $n, m$ ($n, m \le 10^5$).
- Second line: $m$ integers $b_1 \dots b_m$.
- Third line: $n$ integers $x_1 \dots x_n$.
- Fourth line: $n$ integers $c_1 \dots c_n$.
#### Output
- Print the maximum cost.
#### Example
Input:
```
3 3
1 2 3
1 5 10
10 10 10
```
Output:
```
45
```
#### Subtasks
- **Subtask 1 (30 points)**: $n \le 20$.
- **Subtask 2 (30 points)**: $n \le 1000$.
- **Subtask 3 (40 points)**: No additional constraints.