Paul is at the orchestra. The string section is arranged in an *r* × *c* rectangular grid and is filled with violinists with the exception of *n* violists. Paul really likes violas, so he would like to take a picture including at least *k* of them. Paul can take a picture of any axis-parallel rectangle in the orchestra. Count the number of possible pictures that Paul can take.

Two pictures are considered to be different if the coordinates of corresponding rectangles are different.
The first line of input contains four space-separated integers *r*, *c*, *n*, *k* (1 ≤ *r*, *c*, *n* ≤ 3000, 1 ≤ *k* ≤ *min*(*n*, 10)) — the number of rows and columns of the string section, the total number of violas, and the minimum number of violas Paul would like in his photograph, respectively.

The next *n* lines each contain two integers *x*<sub class="lower-index">*i*</sub> and *y*<sub class="lower-index">*i*</sub> (1 ≤ *x*<sub class="lower-index">*i*</sub> ≤ *r*, 1 ≤ *y*<sub class="lower-index">*i*</sub> ≤ *c*): the position of the *i*-th viola. It is guaranteed that no location appears more than once in the input.
We will use '*' to denote violinists and '#' to denote violists.

In the first sample, the orchestra looks as follows: 

In the second sample, the orchestra looks as follows: 

In the third sample, the orchestra looks the same as in the second sample.
from itertools import combinations
import bisect

r, c, n, k = [int(i) for i in input().split()]

points = [[int(i) for i in input().split()] for _ in range(n)]

sum_count = 0

l_lst, r_lst = [], []

for permutation in combinations(points, k):
    row_min, row_max, col_min, col_max = r, 1, c, 1
    for row, col in permutation:
        if row < row_min:
            row_min = row
        if row > row_max:
            row_max = row
        if col < col_min:
            col_min = col
        if col > col_max:
            col_max = col
    # 左上角点位，右下角点位
    point_l, point_r = (row_min, -col_min), (-row_max, col_max)
    if l_lst:
        # 计算插入位置
        l_ind = bisect.bisect(l_lst, point_l)
        if l_ind != len(l_lst) and point_l[1] >= l_lst[l_ind][1]:
            s_l_ins, s_l_dff = row_min * col_min, 0
        else:
            l_ind_ = l_ind - 1
            s_l_dff = 0
            while l_ind_ >= 0 and point_l[1] <= l_lst[l_ind_][1]:
                s_l_dff += (point_l[0] - l_lst[l_ind_][0]) * (l_lst[l_ind_][1] - point_l[1])
                l_ind_ -= 1
            s_l_dff += (point_l[0] - l_lst[l_ind_][0]) * (l_lst[l_ind_ + 1][1] - point_l[1])
            s_l_ins = row_min * col_min - s_l_dff
            if l_ind != len(l_lst) and point_l[1] == l_lst[l_ind][1]:
                l_lst[(l_ind_ + 1):(l_ind + 1)] = [point_l, ]
            else:
                l_lst[(l_ind_ + 1):l_ind] = [point_l, ]
        r_ind = bisect.bisect(r_lst, point_r)
        if r_ind != len(r_lst) and point_r[1] >= r_lst[r_ind][1]:
            s_r_ins, s_r_dff = (r - row_max + 1) * (c - col_max + 1), 0
        else:
            r_ind_ = r_ind - 1
            s_r_dff = 0
            while r_ind_ >= 0 and point_r[1] >= r_lst[r_ind_][1]:
                s_r_dff += (point_r[1] - r_lst[r_ind_][1]) * (point_r[0] - r_lst[r_ind_][0])
                r_ind_ -= 1
            s_r_dff += (point_r[1] - r_lst[r_ind_ + 1][1]) * (point_r[0] - r_lst[r_ind_][0])
            s_r_ins = (r - row_max + 1) * (c - col_max + 1) - s_r_dff
            if r_ind != len(r_lst) and point_r[1] == r_lst[r_ind][1]:
                r_lst[(r_ind_ + 1):(r_ind + 1)] = [point_r, ]
            else:
                r_lst[(r_ind_ + 1):r_ind] = [point_r, ]
        sum_count += s_l_ins * s_r_dff + s_l_dff * s_r_ins + s_l_dff * s_r_dff
    else:
        l_lst.append((row_min, -col_min))
        r_lst.append((-row_max, col_max))
        sum_count = row_min * col_min * (r - row_max + 1) * (c - col_max + 1)

print(sum_count)