A flat panel has two holes and some pins nailed onto its front surface. From behind the panel a string comes up through one hole, is laid on the surface as a polygonal chain, and passes back behind the panel through the other hole. Initially the string touches none of the pins.
We tie a stone of equal weight to each of the string's two ends. The stones slowly pull the string tight until no slack is left. Obstructed by some of the pins, the string settles into a new polygonal chain (in some layouts it is obstructed by no pin at all). While being pulled tight the string never catches on itself, so its final shape is a polygonal chain whose interior vertices are pin positions and whose two endpoints are the holes.
The string, the pins and the holes are thin enough that their sizes may be ignored. Write a program that computes the length of the tightened chain that lies on the surface.
The input consists of several datasets and ends with a line containing two zeros separated by a space.
Each dataset has the following format, where $l = m + n$:
m n
x1 y1
...
xl yl
The first line contains two integers $m$ and $n$ ($2 \le m \le 100$, $0 \le n \le 100$): $m$ is the number of vertices that describe the initial string (the two holes included) and $n$ is the number of pins. Each of the following $l = m + n$ lines holds two integers $x_i$ and $y_i$ ($0 \le x_i \le 1000$, $0 \le y_i \le 1000$), the coordinates of a point $P_i = (x_i, y_i)$.
No two points coincide, and no three points are collinear.
For each dataset, print on its own line the length of the tightened string that remains on the surface, rounded to exactly three digits after the decimal point. Print nothing else.