solved codechef 2014 JULY FROGV