solved codechef 2014 JULY RETPO