Constraints mentioned are wrong


#1

The constraints mentioned in the question are up to 10^9. I have got a TLE on 2147483647 which is definitely greater than 10^9 according to me. And if I check its expected output it shows me INVALID INPUT.


#2

yes right . use long long int in binary search.