Google Code Jam 2014 - Round1C - B. Reordering Train Cars.