若是凉夜已成梦

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


  • 运维

  • 前端

  • 编程

  • 随笔

  • hust-oj

1591: Rope Crisis in Ropeland !

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

题目描述

Rope-pulling (also known as tug of war) is a very popular game in Ropeland, just like cricket is in Bangladesh. Two groups of players hold different ends of a rope and pull. The group that snatches the rope from the other group is declared winner.

Due to a rope shortage, the king of the country has declared that groups will not be allowed to buy longer ropes than they require.

Rope-pulling takes place in a large room, which contains a large round pillar of a certain radius. If two groups are on the opposite side of the pillar, their pulled rope cannot be a straight line. Given the position of the two groups, find out the minimum length of rope required to start rope-pulling. You can assume that a point represents the position of each group.

Two groups with the round pillar between them.

Two groups unaffected by the pillar

输入

The first line of the input file contains an integer N giving the number of input cases. Then follow N lines, each containing five numbers X1, Y1, X2, Y2, and R, where (X1, Y1) and (X2, Y2) are the coordinates of the two groups and R > 0 is the radius of the pillar.

The center of the pillar is always at the origin, and you may assume that neither team starts in the circle. All input values except for N are floating point numbers, and all have absolute value <= 10,000.

输出

For each input set, output a floating point number on a new line rounded to the third digit after the decimal point denoting the minimum length of rope required.

样例输入

2
1 1 -1 -1 1
1 1 -1 1 1

样例输出

3.571
2.000

参考代码

暂无

解析

暂无

hustoj

发表评论 取消回复

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

*
*


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

若是凉夜已成梦

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

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

友情链接

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