题目描述
Dermuba Triangle is the universally-famous flat and triangular region in the L-PAX planet in the Geometria galaxy. The people of Dermuba live in equilateral-triangular fields with sides exactly equal to 1 km. Houses are always built at the circumcenters of the triangular fields. Their houses are numbered as shown in the figure below.
When Dermubian people visit each other, they follow the shortest path from their house to the destination house. This shortest path is obviously the straight-line distance that connects these two houses. Now comes your task. You have to write a program which computes the length of the shortest path between two houses given their house numbers.
输入
The input consists of several lines with two non-negative integer values n and m which specify the start and destination house numbers, where 0 <= n, m<= 2,147,483,647.
输出
For each line in the input, print the shortest distance between the given houses in kilometers rounded off to three decimal places.
样例输入
0 7
2 8
9 10
10 11
样例输出
1.528
1.528
0.577
0.577
参考代码
暂无
解析
暂无