My First Medium level problem in codechef :P