So for this test: 0 0 90 5 0 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 correct answer is 31.4159, right? Edited by author 01.02.2019 23:40 Anybody else? I guess it's the epsilon. But I failed all trial. test 27: x==kx &&y==ky good luck... Can anybody explain the problem of test 3? I'm getiing WA again and again :( Edited by author 22.06.2016 19:38 What an amusing problem! Now it seems to be easy  in contrast to prima facie :^) Special thanks to Vorokh Sergey and Mamonov Anton, who proved correctness of my solution. And some test data input #1: 0 0 90 5 5 4.9 output #1: 28.2176 input #2: 0 0 90 5 0 0.000001 output #2: 31.4159 Can you explain the answer to the input#1? Are you sure there isn't 3rd case when initial path is a piece of line? Especially when crumb is closer to back side of the right circle. line+arc is never necessary. At least on given tests. How can cockroach reach the crump if it in circle he starting running along (I mean circle which center is closer to crumb). Can he go stright ahead and then go along the circle or he has to go along other circle firstly??? I' ve tried both variants.. but i have WA#13. I've tried lots of variants of my solution... But if the optimal solution in this case is spiral, it gonna fail... BTW, here is approximately this very test after my normalization: 0 0 90 94.85 4.5 10.07 My answer is 605.5647, but it seems to be wrong P.S. My geometry has always been unbeatable, so one day I will solve this problem ;) It is realy wrong Right one is 604.4120 Edited by author 27.08.2008 22:14 What mean "the minimal turning radius of the cockroach"? Edited by author 22.12.2006 19:29 It means that no arc on a cocroach path can have radius less than R. Lines are considered as arcs of infinite radius and sharp turns are considered as arcs of 0 radius. WA#3!!! I cann't find the mistake in my code. I don't know what is wrong! Anybody please HELP ME!!!!!!!!! You got WA3 because this test was incorrect. It is fixed now. Now you have WA22 :) Maybe this test will help you: 1 1 90 1 0 0 Correct answer is 3*PI/2. Good luck! Thanks for the test, it helped me, but there are still mistakes. My program passes all tests which I has found in a forum, and has thought up People!!! Please help me!!!Anybody know what input data in test#3??? 0 0 180 10 30 0 Answer: 67.8509 0 0 0 10 30 0 Answer: 30 Edited by author 12.05.2006 23:34 Absolutely the same solution first time got WA(15)  and then AC... Probably tests were changed? It happens :) 
