Explain the value of x and y

sir, I want to know that have you built the relation x= (i+1) *(j+1) and y = (n-i) *(m-j)
please explain

@Tanvi-Varshney-250726472940778


a cell(green) will be included if a sub matrix top left corner lies in pink and bottom right lies in yellow,
now considering the dimensions, we get the formula