CodeChef July Challenge, Chef And Frogs, AC.