Find the first element greater than x in a sorted array