#GYM104603C. Chromatic

Chromatic

Description

A group of $N$ friends is going to paint their houses violet. They have $N$ cans of blue paint and $N$ cans of red paint. They are going to distribute the paint so that each person receives one can of each color. It doesn't matter how much paint of each color they receive, but they want the distribution of the total paint to be as equitable as possible. That is, they want the difference between the person who receives the most paint and the one who receives the least to be as small as possible.

Given the amount of paint in each can, what is the minimum difference?

The first line contains an integer $N$ $(2 \leq N \leq 10^5)$, the number of friends.

The second line contains $N$ integers: $A_1,\ldots, A_N$ ($1\leq A_i\leq 10^9$), the amount of paint in each of the $N$ cans of red paint.

Finally, the third line contains $N$ integers: $B_1,\ldots, B_N$ ($1\leq B_i\leq 10^9$), the amount of paint in each of the $N$ cans of blue paint.

A single line with an integer indicating the smallest possible difference between the amount of paint received by the person who receives the most paint, and the amount received by the person who receives the least.

Input

The first line contains an integer $N$ $(2 \leq N \leq 10^5)$, the number of friends.

The second line contains $N$ integers: $A_1,\ldots, A_N$ ($1\leq A_i\leq 10^9$), the amount of paint in each of the $N$ cans of red paint.

Finally, the third line contains $N$ integers: $B_1,\ldots, B_N$ ($1\leq B_i\leq 10^9$), the amount of paint in each of the $N$ cans of blue paint.

Output

A single line with an integer indicating the smallest possible difference between the amount of paint received by the person who receives the most paint, and the amount received by the person who receives the least.

2
1 2
1 2
3
1000000000 1 1000000000
1000000000 1 1000000000
0
999999999

Note

In the first example, the optimal paint distribution can be achieved as follows: The first friend receives $1$ unit of blue paint and $2$ units of red paint, which is a total of $3$ units of paint. The second friend receives $1$ unit of red paint and $2$ units of blue paint, which is also a total of $3$ units of paint. Therefore, the difference between the person who receives the most paint and the one who receives the least paint is $3 - 3 = 0$.