The Great Truce
The intense heat was drying out the soil, causing the Vengunga River to shrink into a single stream. The ancient elephant, Hathi, who had lived for over a century, lifted his trunk and announced the start of the Water Truce, just as his father had done fifty years earlier.
The smaller creatures, like the musk shrews, are best equipped to handle the water scarcity. With the Venchuga River now shallow, the shrew tribe decided to move to the opposite bank and redistribute their supplies. This means that from each burrow on one bank, a portion of the supplies must be transported to every burrow on the other bank. During the Water Truce, as per Hathi's decree, the Venchuga River can only be crossed at right angles to the current.
Calculate the total of all the shortest distances between each pair of burrows located on opposite banks of the Venchuga River.
Input
Assume the river is depicted as a strip, with one bank defined by two points on the plane and the other bank by a single point.
The first line provides the number n (1 ≤ n ≤ 5000) of shrew burrows. The next n lines each contain a pair of numbers representing the coordinates of the shrew burrows. All coordinates are within 10^9 in absolute value. Following this, the coordinates of three points defining the river banks are given (the first two points define one of the banks). Each point is situated on one side of the river, meaning there are no points between the banks or on their boundary.
Output
Output the total of all the shortest distances for each pair of burrows on opposite banks of the Venchuga River. The result must be accurate to 10^{-4}.