You are given a simple $$$N$$$-gon on the $$$xy$$$-plane all of whose edges are parallel to either the $$$x$$$-axis or the $$$y$$$-axis (that is, a polygon with no self-intersections and no holes).
There are $$$M$$$ speech locations on the boundary of this polygon.
When movement is allowed only along the boundary of this polygon, find the minimum total travel distance required to visit all speech locations exactly once.
The starting point and ending point of the movement may be chosen arbitrarily on the boundary of the polygon.
The first line contains the number of vertices $$$N$$$ of the polygon and the number of speech locations $$$M$$$. ($$$4 \leq N \leq 10^5, 1 \leq M \leq 10^5$$$)
The $$$(i+1)$$$-th line contains the coordinates $$$(x_i, y_i)$$$ of the $$$i$$$-th vertex of the simple $$$N$$$-gon. ($$$1 \leq i \leq N, |x_i| , |y_i| \leq 10^5$$$) The edges of the polygon connect the $$$i$$$-th vertex and the $$$(i+1)$$$-th vertex. In other words, exactly one of $$$x_{i}=x_{i+1}$$$ or $$$y_{i}=y_{i+1}$$$ holds. (The $$$(N+1)$$$-th vertex denotes the $$$1$$$-st vertex.) No vertex lies on an edge. (That is, there is no vertex with an angle of $$$180$$$ degrees.)
The $$$(j + 1 + N)$$$-th line contains the coordinates $$$(p_j, q_j)$$$ of the $$$j$$$-th speech location. ($$$1 \leq j \leq M, |p_j|, |q_j| \leq 10^5$$$) These points are all distinct and lie on the boundary of the given polygon. (This includes vertices.)
All input values are integers.
Print the answer.
4 30 03 03 20 20 03 03 2
5
6 40 03 03 12 12 20 23 00 22 11 2
5
10 10-12 -11-12 93 93 1-3 1-3 -18 -18 -10-5 -10-5 -113 13 77 -1-3 0-4 -10-12 8-10 -11-3 9-12 -108 -7
74
In the first example, there are points on three vertices of a rectangle, and visiting them in the order $$$(0, 0) \rightarrow (3, 0) \rightarrow (3, 2)$$$ gives the shortest total travel distance, which is $$$3+2=5$$$.
Figure for Sample Input $$$1$$$
Figure for Sample Input $$$2$$$
Figure for Sample Input $$$3$$$
| Name |
|---|


