Time limit
1s
Memory limit
128 MB
Several fire pumps and several fire engines are located on a straight line. Each fire engine must be connected to one pump with a hose in order to fill it with water. The number of pumps is at least the number of fire engines.

In the situation shown, two fire engines are at positions 27 and 73, and three pumps are at positions 12, 50, and 81.
A pump can be connected to at most one fire engine. The length of a hose is the distance between the connected pump and fire engine. Since all fire engines will be filled at the same time, the total length of the selected hoses should be as small as possible.
In the situation shown, connecting the first fire engine to the pump at position 12 and the second fire engine to the pump at position 81 gives a total hose length of 15 + 8 = 23. This is the minimum possible total.
Given the positions of the pumps and the fire engines, write a program that connects every fire engine to a distinct pump while minimizing the total hose length.
The first line contains two integers P and F, the number of pumps and the number of fire engines.
1 <= P <= 100,0001 <= F <= 100,000P >= FThe second line contains P distinct positive integers in increasing order, the positions of the pumps.
The third line contains F distinct positive integers in increasing order, the positions of the fire engines.
A pump and a fire engine may be at the same position. Every position in the input is at most 1,000,000.
Print the minimum possible total length of the hoses. The answer does not exceed 2^31 - 1.