Codeforces Round #334 (Div. 1)C. Lieges of Legendre

NoSuchKey