Codeforces Round #500 (Div. 2) [based on EJOI]--E. Hills

NoSuchKey