public static int binSearchLess(int[] A, int target, int start, int end) {//AC
    	if (start == end) return start;
    	else {
    		int mid;
    		while (start < end) {
    			mid = (start + end) / 2;
        		if (A[mid] < target) {
        			start = mid+1;
        		}
        		else {
        			end = mid-1;
        		}
    		}
    		if (A[start] == target) return start;
    		else return start+1;
    	}
    }