code jam 2013 - Q4

answer incorrect