Imagine a perfectly regular honeycomb that tiles the entire infinite Cartesian plane: an interlocking grid of congruent regular hexagons. One hexagon is placed so that its center is at the origin and two of its opposite corners lie on the $x$-axis, so every hexagon has a flat top edge and a flat bottom edge with pointed left and right corners. The side length of the hexagons is given.
To avoid getting lost, a bee always travels from a point A to a point B by the same rule:
Among all routes allowed by this rule the bee takes one of minimum total length. If A and B already lie in the same hexagon, the bee simply flies straight from A to B without visiting any center.
The figure below shows one such minimum-length route from A to B.

Each data set is one line containing 5 floating-point numbers. The first number is the side length of the hexagons, in centimeters. The next two numbers are the $x$ and $y$ coordinates of point A, and the last two are the $x$ and $y$ coordinates of point B. Neither A nor B ever lies exactly on a border between two hexagons. The input ends with a line of five zeroes, which is not processed.
For each data set, print on its own line the minimum length of the bee's path from A to B, in centimeters, rounded to the nearest $0.001$ centimeter (exactly three digits after the decimal point).