Andrey Kim's submission of Lucky Edge | CodeChef