import sys

import numpy as np



I = np.array(sys.stdin.read().split(), dtype=np.int64)

n, m, q = I[:3]

l, r = I[3:3+m*2].reshape(-1, 2).T

p, q = I[3+m*2:].reshape(-1, 2).T



def main():

    res = np.zeros((n+2, n+2), dtype=np.int64)



    np.add.at(res, (1, r), 1)

    res[1, n+1] += -1 * m

    np.add.at(res, (l+1, r), -1)

    np.add.at(res, (l+1, n+1), 1)

    res = np.cumsum(res, axis=1)

    res = np.cumsum(res, axis=0)



    ans = res[p, q]

    return ans



if __name__ == '__main__':

    ans = main()

    print(*ans, sep='\n')

import sys



*I, = map(int, sys.stdin.read().split())

n, m, Q = I[:3]

lr = zip(*[iter(I[3:3+m*2])] * 2)

pq = zip(*[iter(I[3+m*2:])] * 2)



def main():

    res = [[0] * (n + 2) for _ in range(n+2)]

    

    for l, r in lr:

        res[1][r] += 1

        res[1][n+1] -= 1

        res[l+1][r] -= 1

        res[l+1][n+1] += 1

    

    for i in range(n+1):

        for j in range(n+1):

            res[i][j+1] += res[i][j]



    for j in range(n+1):

        for i in range(n+1):

            res[i+1][j] += res[i][j]

    

    for p, q in pq:

        yield res[p][q]



if __name__ == '__main__':

    ans = main()

    print(*ans, sep='\n')

import sys
import numpy as np

I = np.array(sys.stdin.read().split(), dtype=np.int64)
n, m, q = I[:3]
l, r = I[3 : 3 + m * 2].reshape(-1, 2).T
p, q = I[3 + m * 2 :].reshape(-1, 2).T


def main():
    res = np.zeros((n + 2, n + 2), dtype=np.int64)
    np.add.at(res, (1, r), 1)
    res[1, n + 1] += -1 * m
    np.add.at(res, (l + 1, r), -1)
    np.add.at(res, (l + 1, n + 1), 1)
    res = np.cumsum(res, axis=1)
    res = np.cumsum(res, axis=0)
    ans = res[p, q]
    return ans


if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

import sys

(*I,) = map(int, sys.stdin.read().split())
n, m, Q = I[:3]
lr = zip(*[iter(I[3 : 3 + m * 2])] * 2)
pq = zip(*[iter(I[3 + m * 2 :])] * 2)


def main():
    res = [[0] * (n + 2) for _ in range(n + 2)]
    for l, r in lr:
        res[1][r] += 1
        res[1][n + 1] -= 1
        res[l + 1][r] -= 1
        res[l + 1][n + 1] += 1
    for i in range(n + 1):
        for j in range(n + 1):
            res[i][j + 1] += res[i][j]
    for j in range(n + 1):
        for i in range(n + 1):
            res[i + 1][j] += res[i][j]
    for p, q in pq:
        yield res[p][q]


if __name__ == "__main__":
    ans = main()
    print(*ans, sep="\n")

-import numpy as np -I = np.array(sys.stdin.read().split(), dtype=np.int64) -n, m, q = I[:3] -l, r = I[3 : 3 + m * 2].reshape(-1, 2).T -p, q = I[3 + m * 2 :].reshape(-1, 2).T +(*I,) = map(int, sys.stdin.read().split()) +n, m, Q = I[:3] +lr = zip(*[iter(I[3 : 3 + m * 2])] * 2) +pq = zip(*[iter(I[3 + m * 2 :])] * 2) -    res = np.zeros((n + 2, n + 2), dtype=np.int64) -    np.add.at(res, (1, r), 1) -    res[1, n + 1] += -1 * m -    np.add.at(res, (l + 1, r), -1) -    np.add.at(res, (l + 1, n + 1), 1) -    res = np.cumsum(res, axis=1) -    res = np.cumsum(res, axis=0) -    ans = res[p, q] -    return ans +    res = [[0] * (n + 2) for _ in range(n + 2)] +    for l, r in lr: +        res[1][r] += 1 +        res[1][n + 1] -= 1 +        res[l + 1][r] -= 1 +        res[l + 1][n + 1] += 1 +    for i in range(n + 1): +        for j in range(n + 1): +            res[i][j + 1] += res[i][j] +    for j in range(n + 1): +        for i in range(n + 1): +            res[i + 1][j] += res[i][j] +    for p, q in pq: +        yield res[p][q]