Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)

Fixed submission:
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N)] for i in range(N)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for k in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        for j in range(p-1, q):
            ans += coordinate[i][j]
    print(ans)

Fixed submission:
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N)] for i in range(N)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for k in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        for j in range(p-1, q):
            ans += coordinate[i][j]
    print(ans)

Fixed submission:
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N)] for i in range(N)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1
PQ = [list(map(int, input().split())) for i in range(Q)]

for pq in PQ:
    p, q = pq
    ans = 0
    for i in range(p-1, q):
        for j in range(p-1, q):
            ans += coordinate[i][j]
    print(ans)

Fixed submission:
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N)] for i in range(N)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1
PQ = [list(map(int, input().split())) for i in range(Q)]

for pq in PQ:
    p, q = pq
    ans = 0
    for i in range(p-1, q):
        for j in range(p-1, q):
            ans += coordinate[i][j]
    print(ans)

Fixed submission:
N, M, Q = map(int, input().split())
coordinate = [[0 for _ in range(N+1)] for i in range(N+1)]
for m in range(M):
    l, r = map(int, input().split())
    coordinate[l-1][r-1] += 1

for i in range(N):
    for j in range(1, N):
        coordinate[i][j] += coordinate[i][j-1]


for i in range(Q):
    p, q = map(int, input().split())
    ans = 0
    for i in range(p-1, q):
        ans += coordinate[i][q-1] - coordinate[i][p-2]
    print(ans)