Codeforces Round #549 (Div. 2)C. Queen

NoSuchKey