private int binary(int[] nums, int l, int r, int target) {
	        if (l > r)
	            return -1;
	        int m = (l + r)/2;
	        if (nums[m] >= target && (m-1 < l || nums[m-1] < target)) {
	            if (m-1 < l || target - nums[m-1] >= nums[m] - target)
	                return m;
	            else
	                return m-1;
	        } else if (m-1 >= l && nums[m-1] >= target)
	            return binary(nums, l, m-1, target);
	        else
	            return binary(nums, m+1, r, target);
	    }