Given a matrix of integers \$M\$ and a list of four integers \$L\$, find the sub-matrix \$N\$ whose corners are given by \$L\$ and return the sum of its elements.
Suppose you're given the list \$L = [-8, -3, 2, 9]\$ and the following matrix \$M\$. The numbers in the list are highlighted in blue to illustrate:
$$ \begin{bmatrix}0 & 2 & -7 & -5 & -6\\ 6 & \boldsymbol{\color{blue}{-3}} & 4 & -2 & \boldsymbol{\color{blue}{9}}\\ -9 & 1 & 8 & -1 & -8\\ 3 & \boldsymbol{\color{blue}{2}} & -4 & 2 & \boldsymbol{\color{blue}{-8}} \end{bmatrix} $$
Your task is to sum the elements in the sub-matrix \$N\$ described by those four corners, in other words the sum of all of the blue numbers below:
$$ \begin{bmatrix}0 & 2 & -7 & -5 & -6\\ 6 & \boldsymbol{\color{blue}{-3}} & \color{blue}{4} & \color{blue}{-2} & \boldsymbol{\color{blue}{9}}\\ -9 & \color{blue}{1} & \color{blue}{8} & \color{blue}{-1} & \color{blue}{-8}\\ 3 & \boldsymbol{\color{blue}{2}} & \color{blue}{-4} & \color{blue}{2} & \boldsymbol{\color{blue}{-8}} \end{bmatrix} $$
In this case the sum (by sheer coincidence) is \$0\$.
Input
Input will consist of a matrix \$M\$ and a list \$L\$ in any convenient format. The matrix may contain duplicate numbers and may even have duplicates of the numbers in \$L\$ but there will be only one sub-matrix whose corners are the numbers in \$L\$.
The numbers in \$L\$ may be in any order and will not necessarily correspond to the order of the corners of \$N\$. The numbers in \$L\$ might not be unique.
\$M\$ will always have at least two rows and two columns. \$N\$ will also always be at least \$2 \times 2\$.
Output
The output should be a single integer—the sum of the elements of \$N\$—in any convenient format.
Rules
Default I/O rules and standard rules apply. Standard loopholes are forbidden.
This is code-golf; shortest solution in bytes wins.
Test cases
Input:
M = 6 9 -7 3
8 -1 -6 -4
2 -7 7 -7
-1 4 7 9
L = -1 8 -7 2
Output: 2
Input:
M = 2 5 -7 4 -6
-4 -2 2 0 -6
1 -4 5 7 6
3 2 -7 -6 -4
L = 6 -6 2 5
Output: 14
Input:
M = 9 6 4 7
5 0 -3 -2
8 -4 -7 9
L = 7 8 9 9
Output: 32
M = 1 2 3
2 3 2
3 2 1
L = 1 3 3 1
Output: 19
[[1, 2, 3], [2, 3, 2], [3, 2, 1]]
, L =[1, 3, 3, 1]
valid? Two of the answers don't output 19 for this case. \$\endgroup\$