Codeforces Round #662 (Div. 2) C. Pinkie Pie Eats Patty-cakes

NoSuchKey