Andrey Kim's submission of Safe Routes | CodeChef