Page 1 of 1

Re: 12920 - Patty's Gift

Posted: Tue Jun 23, 2015 8:27 pm
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?

Re: 12920 - Patty's Gift

Posted: Wed Sep 02, 2015 12:43 am
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!