12920 - Patty's Gift

All about problems in Volume 129. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

Post Reply
nealzane
New poster
Posts: 23
Joined: Tue Dec 10, 2002 2:13 am
Location: China
Contact:

Re: 12920 - Patty's Gift

Post by nealzane »

Can the sample data be explained:

Input

Code: Select all

2 5 7 4 5.099
Output

Code: Select all

7 4
My concern is, the distance from (2, 5) to (7, 4) is sqrt(26) = 5.099019514 which is greater than the given 5.099, so here is the case that if the string is shorter than the distance of the nails, what happends?

The problem is looking at the precision of 1.0e-6 while this input is off the tolerance, and is this data actually in the test data?
8-)
Fabio Avellaneda
New poster
Posts: 1
Joined: Wed Sep 02, 2015 12:40 am

Re: 12920 - Patty's Gift

Post by Fabio Avellaneda »

Hi nealzane

No worries. In the problem's dataset there is not such case, that is, you wont find any case where the string is shorter than the distance between the nails.

Regards!
Post Reply

Return to “Volume 129 (12900-12999)”