Codeforces Round #165 (Div. 2) C. Magical Boxes

NoSuchKey