Dinesh Goyal's submission of Perfection | CodeChef