Where is the problem

@anujsharmabadboy
I have made the required changes, it gets accepted on SPOJ.

if(c)
    {  
        ans=max(ans,mid);
        start=mid+1;
    }
    else 
    end=mid-1;