max distance for j-i while A[j] > A[i]