RT,如下。
Kirill has two integer arrays a1,a2,…,an and b1,b2,…,bn of length n. He defines the absolute beauty of the array b as
i=1∑n∣ai−bi∣Here, ∣x∣ denotes the absolute value of x.
Kirill can perform the following operation at most once:
Help him find the maximum possible absolute beauty of the array b after performing at most one swap.
Kirill has two integer arrays $a_1,a_2,…,a_n$ and $b_1,b_2,…,b_n$ of length $n$. He defines the _absolute beauty_ of the array $b$ as
$$
\sum_{i=1}^n|a_i-b_i|
$$
Here, $|x|$ denotes the absolute value of $x$.
Kirill can perform the following operation **at most once**:
- select two indices $i$ and $j$ ($1≤i<j≤n$) and swap the values of $b_i$ and $b_j$.
Help him find the maximum possible absolute beauty of the array $b$ after performing **at most one** swap.