codeforces; solve "Bit++" from Round #173 (Div. 2)