Upper Bound Using Binary Search Code In Cpp