codeforce:vltux's solution for 262.2 C Present
codefores:initialize state array in each loop when binary searching