Andrey Kim's submission of Magic Sticks | CodeChef