Code from the Mind Sports Olympiad XVIII Programming event, August 2014.