public int findNearest(int[] num, int target){
		int i = 0;
		int j = num.length - 1;
		int mid = 0;
		while(i <= j){
			mid = (i + j) >> 1;
			if(num[mid] == target){
				return mid;
			}else if(num[mid] > target){
				 j = mid - 1;
			}else{
				i = mid + 1;
			}
		}
		return mid;
	}