Lovish's submission of Problem6 | CodeChef