{"problem":{"name":"Snuke's Coloring","description":{"content":"We have a grid with $H$ rows and $W$ columns. At first, all cells were painted white. Snuke painted $N$ of these cells. The $i$\\-th ( $1 \\leq i \\leq N$ ) cell he painted is the cell at the $a_i$\\-th r","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":3000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"arc061_b"},"statements":[{"statement_type":"Markdown","content":"We have a grid with $H$ rows and $W$ columns. At first, all cells were painted white.\nSnuke painted $N$ of these cells. The $i$\\-th ( $1 \\leq i \\leq N$ ) cell he painted is the cell at the $a_i$\\-th row and $b_i$\\-th column.\nCompute the following:\n\n*   For each integer $j$ ( $0 \\leq j \\leq 9$ ), how many subrectangles of size $3×3$ of the grid contains exactly $j$ black cells, after Snuke painted $N$ cells?\n\n## Constraints\n\n*   $3 \\leq H \\leq 10^9$\n*   $3 \\leq W \\leq 10^9$\n*   $0 \\leq N \\leq min(10^5,H×W)$\n*   $1 \\leq a_i \\leq H$ $(1 \\leq i \\leq N)$\n*   $1 \\leq b_i \\leq W$ $(1 \\leq i \\leq N)$\n*   $(a_i, b_i) \\neq (a_j, b_j)$ $(i \\neq j)$\n\n## Input\n\nThe input is given from Standard Input in the following format:\n\n$H$ $W$ $N$\n$a_1$ $b_1$\n:\n$a_N$ $b_N$\n\n[samples]","is_translate":false,"language":"English"}],"meta":{"iden":"arc061_b","tags":[],"sample_group":[["4 5 8\n1 1\n1 4\n1 5\n2 3\n3 1\n3 2\n3 4\n4 4","0\n0\n0\n2\n4\n0\n0\n0\n0\n0\n\n![image](https://atcoder.jp/img/arc061/30326702be007759dce81231012a8353.png)\nThere are six subrectangles of size $3×3$. Two of them contain three black cells each, and the remaining four contain four black cells each."],["10 10 20\n1 1\n1 4\n1 9\n2 5\n3 10\n4 2\n4 7\n5 9\n6 4\n6 6\n6 7\n7 1\n7 3\n7 7\n8 1\n8 5\n8 10\n9 2\n10 4\n10 9","4\n26\n22\n10\n2\n0\n0\n0\n0\n0"],["1000000000 1000000000 0","999999996000000004\n0\n0\n0\n0\n0\n0\n0\n0\n0"]],"created_at":"2026-03-03 11:01:13"}}