I like this problem too. I got AC, but I don't understand, what are the 'special cases'?
> change 3D into 2D
>
This is what I did!
Then I check everything right as you say:
____if { thread is outside } then
________Result := { AB distance }
____else
________Result :=
____________{ tangent from A } + { tangent from B } +
____________{ a small arc between tangents }
And that's all!
I didn't check any 'special cases'...
I didn't care about them.
I didn't see them at all!
But I got AC (0.015 sec, 415 Kb), see here:
http://acm.timus.ru/status.aspx?space=1&pos=851589.So... I'd like to find it out, what are the special cases, that I missed...
Can you tell me, please?