private static int binarySearch(int[] A, int target, int l, int r) {
		while (l <= r) {
			int mid = l + (r - l) / 2;
			if (target > A[mid]) {
				l = mid + 1;
			} else if (target == A[mid]) {
				return mid;
			} else {
				r = mid - 1;
			}
		}
		return -1;
	}