Sherlock And Cost Hackerrank Solution In C