Buggy python submission (verdict: Time Limit Exceeded):
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = [input().split(" ") for i in range(N)]
A = [[int(l[0])-1, int(l[1])-1] for l in A]

sq3_3 = [[0 for w in range(W - 3 + 1)] for h in range(H - 3 + 1)]

for p, q in A:
    for k in [0, 1, 2]:
        for l in [0, 1, 2]:
            if 0 <= p-k < H-3+1 and 0 <= q-l < W-3+1:
                sq3_3[p - k][q - l] += 1

l = []
for s in sq3_3:
    l += s

for i in range(10):
    print(l.count(i))

Fixed submission:
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = []
for i in range(N):
    A.append([int(j) for j in input().split(" ")])


import itertools
from collections import defaultdict, Counter

c = defaultdict(int)
for a, b in A:
    # そのセルを含む正方形の中心を記録
    for dx,dy in itertools.product([-1,0,1],repeat = 2):
        aa = a + dx
        bb = b + dy
        if 2 <= aa <= H-1 and 2 <= bb <= W-1:
            c[(aa,bb)] += 1
            
result = Counter(c.values())
result[0] = (H-2)*(W-2) - sum(result.values())
 
for j in range(10):
    print(result[j])

Buggy python submission (verdict: Time Limit Exceeded):
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = [input().split(" ") for i in range(N)]
A = [[int(l[0])-1, int(l[1])-1] for l in A]

sq3_3 = [[0 for w in range(W - 3 + 1)] for h in range(H - 3 + 1)]
sq3_3

for p, q in A:
    for k in [0, 1, 2]:
        for l in [0, 1, 2]:
            if 0 <= p-k < H-3+1 and 0 <= q-l < W-3+1:
                sq3_3[p - k][q - l] += 1
sq3_3

l = []
for s in sq3_3:
    l += s

for i in range(10):
    print(l.count(i))

Fixed submission:
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = []
for i in range(N):
    A.append([int(j) for j in input().split(" ")])


import itertools
from collections import defaultdict, Counter

c = defaultdict(int)
for a, b in A:
    # そのセルを含む正方形の中心を記録
    for dx,dy in itertools.product([-1,0,1],repeat = 2):
        aa = a + dx
        bb = b + dy
        if 2 <= aa <= H-1 and 2 <= bb <= W-1:
            c[(aa,bb)] += 1
            
result = Counter(c.values())
result[0] = (H-2)*(W-2) - sum(result.values())
 
for j in range(10):
    print(result[j])

Buggy python submission (verdict: Runtime Error):
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = [input().split(" ") for i in range(N)]
A = [[int(l[0])-1, int(l[1])-1] for l in A]


black_num = [0 for i in range(10)]

import numpy as np
field = np.array([np.array([1 if [i, j] in A else 0 for j in range(W)]) for i in range(H)])

for h in range(H - 3 + 1):
    for w in range(W - 3 + 1):
        black_num[np.sum(field[h:h+3].T[w:w+3].T)] += 1
for i in black_num:
    print(i)

Fixed submission:
H, W, N = input().split(" ")
H, W, N = int(H), int(W), int(N)
A = []
for i in range(N):
    A.append([int(j) for j in input().split(" ")])


import itertools
from collections import defaultdict, Counter

c = defaultdict(int)
for a, b in A:
    # そのセルを含む正方形の中心を記録
    for dx,dy in itertools.product([-1,0,1],repeat = 2):
        aa = a + dx
        bb = b + dy
        if 2 <= aa <= H-1 and 2 <= bb <= W-1:
            c[(aa,bb)] += 1
            
result = Counter(c.values())
result[0] = (H-2)*(W-2) - sum(result.values())
 
for j in range(10):
    print(result[j])