Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = (y - 1) * w + (x - 1)
                if index in searched: continue
                searched[index] = True

                count = 0
                for target in poses:
                    if x <= target[1] and target[1] <= x + 2 and \
                       y <= target[0] and target[0] <= y + 2:
                       count += 1
                counts[count] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    for v in counts: print(v)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)

Fixed submission:
import numpy as np

def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = y * w + x
                if index in searched:
                    searched[index] = searched[index] + 1
                else:
                    searched[index] = 1

    for v in searched.values():
        counts[v] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    for v in counts: print(v)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)

Buggy python submission (verdict: Runtime Error):
def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = (y - 1) * w + (x - 1)
                if index in searched: continue
                searched[index] = True

                count = 0
                for target in poses:
                    if x <= target[1] and target[1] <= x + 2 and \
                       y <= target[0] and target[0] <= y + 2:
                       count += 1
                counts[count] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    print(counts)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)

Fixed submission:
import numpy as np

def snuke_coloring(h, w, poses):
    counts = np.zeros(10, np.int64)
    searched = {}

    for pos in poses:
        for y in range(max(1, pos[0] - 2), min(h - 2, pos[0]) + 1):
            for x in range(max(1, pos[1] - 2), min(w - 2, pos[1]) + 1):
                index = y * w + x
                if index in searched:
                    searched[index] = searched[index] + 1
                else:
                    searched[index] = 1

    for v in searched.values():
        counts[v] += 1

    nonzero_count = int(np.sum(counts))
    counts[0] = (h - 2) * (w - 2) - nonzero_count
    for v in counts: print(v)

h, w, n = map(int, input().split())
poses = [tuple(map(int, input().split())) for _ in range(n)]
snuke_coloring(h, w, poses)