CodeChef problems solution