@anubhavb11 this question has to be done with binary search
but whats wrong with my code?
@anubhavb11 one of the cases 10 3 1 1 ans = 6 yours = 10
code- https://ide.codingblocks.com/s/294793 still not passing all test case
@anubhavb11 just use long long int it passes all
@anubhavb11 is it ok now?