Codechef's solution