Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
square = set()
dot = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    dot[(a, b)] = 1
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                square.add((y, x))
ans = [0] * 10
for y, x in square:
    c = 0
    for i in range(y, y+3):
        for j in range(x, x+3):
            c += dot[(i, j)]
    ans[c] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(square)
for i in ans:
    print(i)


Fixed submission:
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                cnt[(y, x)] += 1
ans = [0] * 10
for key in cnt:
    ans[cnt[key]] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(cnt)
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
square = set()
dot = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    dot[(a, b)] = 1
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                square.add((y, x))
ans = [0] * 10
for y, x in square:
    c = 0
    for i in range(y, y+3):
        for j in range(x, x+3):
            c += dot[(i, j)]
    ans[c] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(square)
for i in ans:
    print(i)


Fixed submission:
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                cnt[(y, x)] += 1
ans = [0] * 10
for key in cnt:
    ans[cnt[key]] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(cnt)
for i in ans:
    print(i)

Buggy python submission (verdict: Runtime Error):
import sys
def input():
    return sys.stdin.readline()[:-1]
from collections import defaultdict
H, W, N = map(int, input().split())
square = set()
dot = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    dot[[a, b]] = 1
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                square.add([y, x])
ans = [0] * 10
for y, x in square:
    c = 0
    for i in range(y, y+3):
        for j in range(x, x+3):
            c += dot[[i, j]]
    ans[c] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(square)
for i in ans:
    print(i)


Fixed submission:
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                cnt[(y, x)] += 1
ans = [0] * 10
for key in cnt:
    ans[cnt[key]] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(cnt)
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
H, W, N = map(int, input().split())
square = set()
dot = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    dot[(a, b)] = 1
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                square.add((y, x))
ans = [0] * 10
for y, x in square:
    c = 0
    for i in range(y, y+3):
        for j in range(x, x+3):
            c += dot[(i, j)]
    ans[c] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(square)
for i in ans:
    print(i)


Fixed submission:
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                cnt[(y, x)] += 1
ans = [0] * 10
for key in cnt:
    ans[cnt[key]] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(cnt)
for i in ans:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
from collections import defaultdict
H, W, N = map(int, input().split())
square = set()
dot = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    dot[(a, b)] = 1
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                square.add((y, x))
ans = [0] * 10
for y, x in square:
    c = 0
    for i in range(y, y+3):
        for j in range(x, x+3):
            c += dot[(i, j)]
    ans[c] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(square)
for i in ans:
    print(i)


Fixed submission:
import sys
input = sys.stdin.readline
from collections import defaultdict
H, W, N = map(int, input().split())
cnt = defaultdict(lambda : 0)
for i in range(N):
    a, b = map(lambda x: int(x)-1, input().split())
    for y in range(a-2, a+1):
        for x in range(b-2, b+1):
            if 0 <= y < H-2 and 0 <= x < W-2:
                cnt[(y, x)] += 1
ans = [0] * 10
for key in cnt:
    ans[cnt[key]] += 1
ans[0] += ans[0] + (H-2) * (W-2) - len(cnt)
for i in ans:
    print(i)