Problem link : http://www.codechef.com/CDBR2015/problems/CDBSTR1 Every one applying binary Search in the above problem.Can anyone explain me the logic?? How to solve this problem?? asked 12 Feb '15, 02:03

In this question the maximum answer can be (smallest +largest)/number of cars packed (it can be less But can never be greater then this) and minimum is 1. So start with a mid value=(max+min)/2. And do binary search . If the result is true increment left and other wise decrement right . Take the maximum of the answer and this will be right then . After doing this, do this one . Uses Binary search .This will help you http://www.iarcs.org.in/inoi/onlinestudymaterial/problems/postelectiontransfers.php Cheers answered 12 Feb '15, 09:49
thanks @adityakhanna1999
(12 Feb '15, 16:47)

Welcome , ever ready to help . Thanks for upvote . answered 12 Feb '15, 17:01
