若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1588: Dermuba Triangle

发表于 2017-10-06   |   分类于 HUSTOJ   |   阅读次数 1,249

题目描述

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


参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

电子邮件地址不会被公开。 必填项已用*标注

*
*


hoxis wechat
著作权归作者所有
站点更新说明
  • 文章目录
  • 站点概览
若是凉夜已成梦

若是凉夜已成梦

青春里 总有些事情要努力去做 总有些梦想要拼命去追。

1904 日志
6 分类
12 标签
RSS
weibo github twitter facebook

友情链接

Skip Dreams孤独患者 原站点
© 2017 若是凉夜已成梦
Powered by WordPress | 已运行
Theme By NexT.Mist