Employees of a very large and very secret agancy work in a large rectangular room. N employees from the first division are seated by the windows of one wall and the same number of employees from the second division are seated along the opposite wall. One day, a very important and very secret memo came in --- computers of all employees of the two divisions were to be connected in such a manner that each first division employee's computer were linked with the corresponding second division employee's computer with a separate wire.
A technical assignment including the room blueprints was drafted. This blueprints showed the room as a A by B rectangle: its left and right sides are of the length A, and the top and bottom sides are of the length B. There are N input contacts on the left wall, corresponding to positions of computers of the first division employees, and N output contacts on the right side for computers of the second division employees. Connect each input with the corresponding output by a wire based on the mutually unambiguous input-output correspondence.
There are rules regarding wires:
Find the minimum total length of wire necessary to connect the contacts in the desired manner, if it is possible. The wire thickness can be considered negligibly small: wires can pass infinitely close to each other.
Write a program which calculates the minimum required number of wires.
The first line of the input file contains three integers: A --- the length of the left side of the rectangle, B --- the length of the upper side of the rectangle and N --- the number of input (and output) contacts (1≤A,B≤108, 1≤N≤105).
The second line describes the positions of all N input contacts. For each k-th input number an integer L_k is given --- the distance from the lower left corner of the rectangle to the contact (0≤L_k≤A). It is guaranteed that all L_k are different.
The third line contains the positions of N output contacts. For each k-th output contact an integer R_k is provided --- the distance from the lower right corner to the contact (0≤R_k≤A). It is guaranteed that all R_k are different.
Connect each k-th (description-wise) input contact with the k-th (description-wise) output contact.
The first line of the output file must contain a single real number --- the minimum total length of all wires in a correct connection scheme. The absolute or relative error must not be greater than 10−9.
If there are no correct ways to do the wiring, print the number −1.
Strictly mathematically speaking, the minimum total length of wires may fail to be achieved with any of the correct wiring plans due to the infinitely small thickness of wires. In this case, find the precise lower margin(infimum) of all possible total lengths.