Mark Kornejchik's submission of Train Partner | CodeChef