There is a $01$-matrix with $m$ rows and $n$ columns that contains exactly $t$ ones, and all of these ones are located in the same row. The row index where the ones are located is $r$, and the column indices are $c_1, c_2, \dots, c_t$. Please calculate the number of $k \times k$ submatrices that contain an odd number of zeros.
For example, in the $3 \times 4$ $01$-matrix shown below, there are $3$ submatrices of size $2 \times 2$ that contain an odd number of zeros, as indicated by the blue submatrices. The red $2 \times 2$ submatrix contains $4$ zeros, so it is not included in the count.
Input
m n t k r c_1 c_2 ... c_t
- $m, n$ are the number of rows and columns of the matrix, respectively.
- $t$ is the number of ones.
- $k$ is the size of the submatrix.
- $r$ is the row index where the $t$ ones are located.
- $c_1, c_2, \dots, c_t$ are the column indices of the ones, and it is guaranteed that $c_i < c_{i+1}$.
Output
x
A single integer $x$, representing the number of $k \times k$ submatrices containing an odd number of zeros.
Constraints
- $1 \le m, n \le 10^9$.
- $0 \le t \le \min(n, 10^5)$.
- $1 \le k \le \min(m, n)$.
- $1 \le r \le m$.
- $1 \le c_i \le n$.
- All input numbers are integers.
Examples
Input 1
3 4 2 2 1 2 4
Output 1
3
Input 2
4 5 3 3 3 1 3 4
Output 2
6
Subtasks
This problem consists of three subtasks. The conditions are as follows. Each subtask may contain one or more test cases, and all test cases in a subtask must be answered correctly to receive the points for that subtask.
| Subtask | Points | Additional Constraints |
|---|---|---|
| 1 | 11 | $m, n \le 1000$ |
| 2 | 41 | $m, n \le 10^5$ |
| 3 | 48 | No additional constraints |