'''
Let A be an N by M matrix in which every row and every column is sorted.

Given i1, j1, i2, and j2, 
compute the number of elements of M smaller than M[i1, j1] and larger than M[i2, j2].
'''


def matrixElems(matrix,i1,j1,i2,j2):


