Connection point
A news story that made the whole country laugh automatically becomes a good one.
The residents of Krilandia have a great fondness for carrot juice. In response, the government of Berlandia has decided to route their main carrot juice pipeline, which delivers a delicious blend of carrot juice with a hint of pine, to bypass Krilandia entirely.
However, the clever Kriliks have devised a plan to secretly tap into the pipeline at one of the vertices of the polygon that defines their country's borders. Naturally, they aim to lay this hidden pipe under the cover of night and as swiftly as possible, meaning the distance to the connection point should be minimized.
To expedite their plan for acquiring this delightful carrot juice, the residents of Krilandia need your help to write a program that calculates the shortest distance to the desired connection point.
Input
The first line contains 4 numbers, representing the coordinates of two points through which the Berlandian main pipeline, supplying carrot juice, is guaranteed to pass: X_1, Y_1 and X_2, Y_2. Following this, the number of vertices of the polygon that bounds Krilandia's territory is provided as n (3 ≤ n ≤ 1000), followed by the coordinates of these vertices X_i, Y_i (1 ≤ i ≤ n). All coordinates are integers and do not exceed 10^9 in absolute value. Numbers are separated by spaces and/or line breaks. It is guaranteed that the Berlandian pipeline does not intersect Krilandia's territory, and that Krilandia's territory has a non-zero area.
Output
Print a single line with the distance to the most likely connection point, ensuring a precision of at least 6 decimal places.