码迷,mamicode.com
首页 > 其他好文 > 详细

ural 1075. Thread in a Space

时间:2015-12-25 20:59:35      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

1075. Thread in a Space

Time limit: 1.0 second
Memory limit: 64 MB
There are three points in a 3-dimensional space: AB and C. All the coordinates of the points are integer numbers with absolute values not greater than 1000. A solid ball with a center in the pointC is firmly fixed. A radius of the ball is R, a positive integer number. Distances from the point Cto the points A and B are strictly greater than R.
It is necessary to stretch a thread of minimal length between points A and B. Surely, the thread should be outside of the ball.
You are to find out a length of the thread.

Input

The first three lines contain coordinates of the points AB and C respectively. The fourth one contains a radius R of the ball.

Output

should contain a minimal length of the thread to within 2 symbols after a decimal point. You should output answer with two or more digits.

Sample

inputoutput
0 0 12
12 0 0
10 0 10
10
19.71
Problem Author: Alexander Mironenko 
Problem Source: Ural State Univerisity Personal Contest Online February‘2001 Students Session

ural 1075. Thread in a Space

标签:

原文地址:http://www.cnblogs.com/StupidBoy/p/5076845.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!