Codeforces Round #525 (Div. 2)-E. Ehab and a component choosing problem

NoSuchKey