private int[] searchMatrix(int a[][], int val) {
int result[] = {-1, -1};
if (a == null || a.length == 0)
return result;
int rstart = 0;
int rend = a.length;
int column = a[0].length;
while (rstart < rend && column > 1) {
int t[] = new int[rend - rstart];
for (int i = rstart;i < rend; i++) {
t[i] = a[i][column - 1];
}
printLog(Arrays.toString(t));
int pos = binarySearch(t, val);
if (t[pos] == val) {
result[0] = pos + rstart;
result[1] = column - 1;
return result;
} else if (t[pos] > val) {
rstart = pos;
column--;
} else {
return result;
}
}