Educational Codeforces Round 76 (Rated for Div. 2) B. Magic Stick

NoSuchKey