ACM ICPC World Finals 2008
This problem can be solved using an exhaustive search. At each step, there are at most 8 possible ways of adding a new elbow. Since there are only 6 elbows available, this means that there are at most ∑6i=1 8i = 299592 possible paths in total.