If you're stuck think like this, having a directed segment AB, you just need a C among the remaining points s.t. <CBA is acute. Fixing A, is there a way to choose B such that any C among remaining will form acute <CBA ? Would someone be so kind to give any tricky tests? I have WA#11 :( My solution get WA 11 too. It work's incorrect at test 2 0 0 3 0 3 2 4 5 Почему в условии задачи сказано, что начальная и конечная точки маршрута фиксированы, а в примерах конечные точки получаются разными? Edited by author 08.07.2013 01:51 If you get WA# 14 this test maybe help you: 2 0 1 1 0 1 1 2 1 answer: YES 1 4 2 3 Angles must be strogly acute? I.e., right angles (pi/2) are restricted? See first sample. It is now absent, but before the sample was corrected there was right angle... My AC solution rejects right angles I got AC when I deleted right angles. I had WA before that. Are there beautifull solution? The one other from bruteforce Yes, there are exists one very beautiful O(N^2) solution. But the practical complexity of this algo is much less :) I can suggest only bruteforce. Edited by author 08.05.2009 16:12 If you can suggest  then try! =) I think, it will be TLE. Sometimes in sportcoding it's better not to think =) This problem has elegant solution which is very easy to code. Try to find it. Thank you very much. I have found the solution. This problem is beautiful. 
