In the manufacture of picture frames, a special type of board is used - a baguette rail. The edges of this rail are treated differently so that the outer and inner edges stand out. Only the inner edge of the lath can be attached to the picture.
Usually the pictures are rectangular. However, one day a small framing workshop where you work as an apprentice carpenter received a new order: to make frames for an exhibition of paintings by avant-garde artists. The preparation of rails for this order is entrusted to you. When you saw the pictures, you were taken aback at first: they are not rectangular! After examining them more closely, you are convinced that each picture has the form of a convex quadrilateral.
Well, the order must be fulfilled... Unfortunately, the first attempt to prepare the material for the frame, based only on the information about the lengths of the sides of the quadrangle, turned out to be unsuccessful - you did not take into account that these values do not uniquely determine the figure. Friends told you that you need to additionally know the length of one of its diagonals.
Can you determine the minimum length of baguette rail that you need to take to make a frame for one of these paintings? To make a frame, four trapezoidal parts are cut out from the lath. The outer and inner borders of the frame must be made from outer and inner edges of baguette rails respectively. The painting must fit into the frame without gaps or overlaps.
The first line contains information about the width of the rail, the second — five values that specify the type and size of the picture. More precisely, if the corners of the picture are denoted (in order of rotation) by the letters $$$A$$$, $$$B$$$, $$$C$$$, $$$D$$$, then the line contains the lengths of the sides $$$AB$$$, $$$BC$$$, $$$CD$$$, $$$DA$$$ and diagonal $$$AC$$$. All numbers are positive, not exceeding $$$10^4$$$ and written with no more than three decimal places.
Выведите рассчитанную длину рейки с точностью до $$$10^{-4}$$$.
2 13 15 25 25 14
102.12605
| Name |
|---|


