stablegradients/pie-gem5-pairs huggingface dataset:
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.175367105029024x):
#include<set>  

#include<map>  

#include<stack>  

#include<cstdio>  

#include<queue>  

#include<cmath>  

#include<vector>  

#include<climits>  

#include<cstring> 

#include<iostream> 

#include<algorithm> 

using namespace std;

#define INF 0x3f3f3f3f

#define LL long long

LL read(){ 

    LL f=1,x=0; 

    char c=getchar(); 

    while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();} 

    while('0'<=c&&c<='9'){x=x*10+c-'0';c=getchar();} 

    return f*x; 

}

#define MAXN 100000

struct node{

	int x,y;

	node(){}

	node(int X,int Y){x=X,y=Y;}

	friend bool operator < (node a,node b){return a.x==b.x?a.y<b.y:a.x<b.x;}

}dot[MAXN+5];

map<node,bool> Map,Use;

LL H,W,N,ans[10];

bool cmp(node a,node b){return a.x==b.x?a.y<b.y:a.x<b.x;}

int main(){

	H=read(),W=read(),N=read();

	for(int i=1;i<=N;i++){

		dot[i].x=read(),dot[i].y=read();

		Map[node(dot[i].x,dot[i].y)]=1;

	}

	for(int i=1;i<=N;i++)

		for(int t=0;t<=8;t++){

			int sx=dot[i].x-t%3,sy=dot[i].y-t/3;

			if(sx<1||sy<1||sx>H-2||sy>W-2||Use.count(node(sx,sy))) continue;

			int tmp=0;

			for(int j=sx;j<sx+3;j++)

				for(int k=sy;k<sy+3;k++)

					if(Map.count(node(j,k))) tmp++;

			Use[node(sx,sy)]=1;

			if(tmp) ans[tmp]++;

		}

	LL tmp=0;

	for(int i=1;i<=9;i++)

		tmp+=ans[i];

	ans[0]=(H-2)*(W-2)-tmp;

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2360920011306682x):
#include<cstdio>

#include<map>

#include<algorithm>

using namespace std;

#define MAXN 100000



long long h,w,ans[10];

int n,x[MAXN+5],y[MAXN+5];

map<pair<int,int>,int>Map;



void Updata(int x,int y) {

	if(x<3||x>h||y<3||y>w) return ;

	int cnt=0;

	for(int i=-2;i<=0;i++)

		for(int j=-2;j<=0;j++)

			cnt+=Map[make_pair(x+i,y+j)];

	ans[cnt]++;

}

int main() {

	scanf("%lld %lld %d",&h,&w,&n);

	ans[0]=(h-2)*(w-2);

	for(int i=1;i<=n;i++) {

		scanf("%d %d",&x[i],&y[i]);

		Map[make_pair(x[i],y[i])]++;

	}

	for(int i=1;i<=n;i++)

		for(int j=0;j<=2;j++)

			for(int k=0;k<=2;k++)

				Updata(x[i]+j,y[i]+k);

	for(int i=1;i<=9;i++)

		ans[i]/=i,ans[0]-=ans[i];

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

	return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

  ios::sync_with_stdio(false);

  int w, h, n;

  cin >> w >> h >> n;

  map<pair<int, int>, int> cnt;

  while (n--) {

    int x, y;

    cin >> x >> y;

    for (int i = x - 3; i < x; i++)

      for (int j = y - 3; j < y; j++)

        if (i >= 0 && j >= 0 && i + 2 < w && j + 2 < h)

          cnt[make_pair(i, j)]++;

  }

  vector<long long> res(10, 0);

  res[0] = (long long) (w - 2) * (h - 2);

  for (auto &it:cnt)

    res[it.second]++, res[0]--;

  for (auto &x:res)

    cout << x << endl;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.1001437840863137x):
#include<cstdio>

#include<algorithm>

#include<map>

#include<cstring>

using namespace std;

#define LL long long

LL h,w,n;

map<LL,LL>m;

int dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};

int dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};

LL ans[10];

void Alter(LL x,LL y)

{

	LL a,b,tmp;

	for(int i=0;i<9;i++)

	{

		a=x+dx[i];b=y+dy[i];

		if(a<1||b<1||a>h-2||b>w-2)continue;

		tmp=(h-2)*(b-1)+a;

		m[tmp]++;

	}

}

int main()

{

	scanf("%lld%lld%lld",&h,&w,&n);

	LL x,y;

	for(LL int i=1;i<=n;i++)

	{

		scanf("%lld%lld",&x,&y);

		Alter(x,y);

	}

	memset(ans,0,sizeof(ans));

	ans[0]=(h-2)*(w-2);

	LL tmp;

	map<LL,LL>::iterator it=m.begin();

	while(it!=m.end())

	{

		tmp=it->second;

		ans[tmp]++;

		ans[0]--;

		it++;

	}

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

	//return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define fi first

#define se second

long long ans[10], h, w, n;

pair<int, int> p[100010];

set<long long> candidate[10];



int main() {

    scanf("%lld%lld%lld", &h, &w, &n);

    for(int i = 0; i < n; i++) {

        scanf("%lld%lld", &p[i].fi, &p[i].se);

        p[i].fi--, p[i].se--;

    }

    sort(p, p + n);

    for(int i = 0; i < n; i++) {

        for(int dx = -2; dx <= 2; dx++) {

            for(int dy = -2; dy <= 2; dy++) {

                int x = p[i].fi + dx, y = p[i].se + dy, z = x + 2, t = y + 2;

                if(x < 0 || y < 0 || z >= h || t >= w) continue;

                int cnt = 0;

                for(int a = 0; a < 3; a++) {

                    for(int b = 0; b < 3; b++) {

                        int c = a + x, d = b + y, f = lower_bound(p, p + n, make_pair(c, d)) - p;

                        if(f < n && p[f].fi == c && p[f].se == d) cnt++;

                    }

                }

                candidate[cnt].insert(x*w + y);

            }

        }

    }

    for(int i = 1; i <= 9; i++) ans[i] = candidate[i].size();

    ans[0] = (h-2) * (w-2);

    for(int i = 1; i <= 9; i++) ans[0] -= ans[i];

    for(int i = 0; i <= 9; i++) printf("%lld\n", ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 1.1256679728860752x):
#include<cstdio>

#include<algorithm>

#include<map>

#include<cstring>

using namespace std;

#define LL long long

LL h,w,n;

map<LL,LL>m;

int dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};

int dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};

LL ans[10];

void Alter(LL x,LL y)

{

	LL a,b,tmp;

	for(int i=0;i<9;i++)

	{

		a=x+dx[i];b=y+dy[i];

		if(a<1||b<1||a>h-2||b>w-2)continue;

		tmp=(h-2)*(b-1)+a;

		m[tmp]++;

	}

}

int main()

{

	scanf("%lld%lld%lld",&h,&w,&n);

	LL x,y;

	for(LL int i=1;i<=n;i++)

	{

		scanf("%lld%lld",&x,&y);

		Alter(x,y);

	}

	memset(ans,0,sizeof(ans));

	ans[0]=(h-2)*(w-2);

	LL tmp;

	map<LL,LL>::iterator it=m.begin();

	while(it!=m.end())

	{

		tmp=it->second;

		ans[tmp]++;

		ans[0]--;

		it++;

	}

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

	//return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2733172567561386x):
#include<cstdio>

#include<algorithm>

#include<map>

#include<cstring>

using namespace std;

#define LL long long

LL h,w,n;

map<LL,LL>m;

int dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};

int dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};

LL ans[10];

void Alter(LL x,LL y)

{

	LL a,b,tmp;

	for(int i=0;i<9;i++)

	{

		a=x+dx[i];b=y+dy[i];

		if(a<1||b<1||a>h-2||b>w-2)continue;

		tmp=(h-2)*(b-1)+a;

		m[tmp]++;

	}

}

int main()

{

	scanf("%lld%lld%lld",&h,&w,&n);

	LL x,y;

	for(LL int i=1;i<=n;i++)

	{

		scanf("%lld%lld",&x,&y);

		Alter(x,y);

	}

	memset(ans,0,sizeof(ans));

	ans[0]=(h-2)*(w-2);

	LL tmp;

	map<LL,LL>::iterator it=m.begin();

	while(it!=m.end())

	{

		tmp=it->second;

		ans[tmp]++;

		ans[0]--;

		it++;

	}

	for(int i=0;i<=9;i++)

		printf("%lld\n",ans[i]);

	//return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.177287660306295x):
#include<iostream>

#include<map>

using namespace std;

typedef long long LL;

typedef map<LL,LL> LLm;

typedef LLm::iterator LLit;

LL h,w,n;

LLm m;

LLit it;

LL ans[10];

LL dx[9]={-2,-2,-2,-1,-1,-1,0,0,0};

LL dy[9]={-2,-1,0,-2,-1,0,-2,-1,0};

void slove(LL x,LL y){

    LL a,b;

    LL temp;

    for(int i=0;i<9;++i){

        a=x+dx[i];

        b=y+dy[i];

        if(a<1 || b<1 || a>h-2 || b>w-2)   continue;

		temp=(w-2)*(a-1)+b;

        temp=(h-2)*(b-1)+a;//对每个小矩形进行编号

		//左上角的位置就只能在(h-2)*(w-2)的矩形区域内

		//每一行有w-2个元素 a-1

        m[temp]++;

    }

}

int main(){

    LL x,y;

    cin>>h>>w>>n;

    for(LL i=0;i<n;++i){

        cin>>x>>y;

        slove(x,y);

    }

    ans[0]=(h-2)*(w-2);//总数

    LL temp;

    for(it=m.begin();it!=m.end();++it){

        temp=it->second;

        ans[temp]++;

        ans[0]--;

    }

    for(LL i=0;i<=9;++i)

        cout<<ans[i]<<endl;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.1778734251532388x):
#include<iostream>

#include<map>

using namespace std;

#define LL long long

LL H,W,N;

LL ans[10];

LL dx[]={-2,-2,-2,-1,-1,-1,0,0,0};

LL dy[]={-2,-1,0,-2,-1,0,-2,-1,0};

map<LL,LL> m;

void slove(LL x,LL y)

{

    LL a,b;

    LL id;

    for(int i=0;i<9;i++){

        a=x+dx[i];

        b=y+dy[i];

        if(a<1 || b<1 || a>H-2 || b>W-2)   continue;

        id=(H-2)*(b-1)+a;//对每个小矩形进行编号

		//左上角的位置就只能在(h-2)*(w-2)的矩形区域内

		//每一行有w-2个元素 a-1

        m[id]++;

    }

}

int main(){

    LL x,y;

    cin>>H>>W>>N;

    for(int i=1;i<=N;i++)

	{

        cin>>x>>y;

        slove(x,y);

    }

    ans[0]=(H-2)*(W-2);//总数

    LL temp;

	map<LL,LL>::iterator it=m.begin();

    for(it=m.begin();it!=m.end();it++){

        temp=it->second;

        ans[temp]++;

        ans[0]--;

    }

    for(int i=0;i<=9;i++)

        cout<<ans[i]<<endl;

    return 0;

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



int main() {

  ios::sync_with_stdio(false);

  int w, h, n;

  cin >> w >> h >> n;

  map<pair<int, int>, int> cnt;

  while (n--) {

    int x, y;

    cin >> x >> y;

    for (int i = x - 3; i < x; i++)

      for (int j = y - 3; j < y; j++)

        if (i >= 0 && j >= 0 && i + 2 < w && j + 2 < h)

          cnt[make_pair(i, j)]++;

  }

  vector<long long> res(10, 0);

  res[0] = (long long) (w - 2) * (h - 2);

  for (auto &it:cnt)

    res[it.second]++, res[0]--;

  for (auto &x:res)

    cout << x << endl;

  return 0;

}

// Faster C++ solution for the same problem (measured speedup: 1.0987863900256676x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cmath>

#include<vector>

#include<map>

#define SF scanf

#define PF printf

#define MAXN 15

using namespace std;

typedef long long ll;

int h,w,n;

int gx[10]={-2,-1,0};

int gy[10]={-2,-1,0};

map<pair<int,int> ,int> used;

ll ans[MAXN];

int main(){

	SF("%d%d",&h,&w);

	SF("%d",&n);

	for(int i=1;i<=n;i++){

		int x,y;

		SF("%d%d",&x,&y);

		for(int i=0;i<3;i++)

			for(int j=0;j<3;j++){

				int xx=x+gx[i];

				int yy=y+gy[j];

				if(xx<1||yy<1||xx+2>h||yy+2>w)

					continue;

				used[make_pair(xx,yy)]++;	

			}

	}

	map<pair<int,int>,int>::iterator it=used.begin();

	for(;it!=used.end();it++){

		ans[it->second]++;

	}

	ll sum=0;

	for(int i=1;i<=9;i++)

		sum+=ans[i];

	ans[0]=(h-2ll)*(w-2ll)-sum;

	for(int i=0;i<=9;i++)

		PF("%lld\n",ans[i]);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define fi first

#define se second

long long ans[10], h, w, n;

pair<int, int> p[100010];

set<long long> candidate[10];



int main() {

    scanf("%lld%lld%lld", &h, &w, &n);

    for(int i = 0; i < n; i++) {

        scanf("%lld%lld", &p[i].fi, &p[i].se);

        p[i].fi--, p[i].se--;

    }

    sort(p, p + n);

    for(int i = 0; i < n; i++) {

        for(int dx = -2; dx <= 2; dx++) {

            for(int dy = -2; dy <= 2; dy++) {

                int x = p[i].fi + dx, y = p[i].se + dy, z = x + 2, t = y + 2;

                if(x < 0 || y < 0 || z >= h || t >= w) continue;

                int cnt = 0;

                for(int a = 0; a < 3; a++) {

                    for(int b = 0; b < 3; b++) {

                        int c = a + x, d = b + y, f = lower_bound(p, p + n, make_pair(c, d)) - p;

                        if(f < n && p[f].fi == c && p[f].se == d) cnt++;

                    }

                }

                candidate[cnt].insert(x*w + y);

            }

        }

    }

    for(int i = 1; i <= 9; i++) ans[i] = candidate[i].size();

    ans[0] = (h-2) * (w-2);

    for(int i = 1; i <= 9; i++) ans[0] -= ans[i];

    for(int i = 0; i <= 9; i++) printf("%lld\n", ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 1.124279086230751x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cmath>

#include<vector>

#include<map>

#define SF scanf

#define PF printf

#define MAXN 15

using namespace std;

typedef long long ll;

int h,w,n;

int gx[10]={-2,-1,0};

int gy[10]={-2,-1,0};

map<pair<int,int> ,int> used;

ll ans[MAXN];

int main(){

	SF("%d%d",&h,&w);

	SF("%d",&n);

	for(int i=1;i<=n;i++){

		int x,y;

		SF("%d%d",&x,&y);

		for(int i=0;i<3;i++)

			for(int j=0;j<3;j++){

				int xx=x+gx[i];

				int yy=y+gy[j];

				if(xx<1||yy<1||xx+2>h||yy+2>w)

					continue;

				used[make_pair(xx,yy)]++;	

			}

	}

	map<pair<int,int>,int>::iterator it=used.begin();

	for(;it!=used.end();it++){

		ans[it->second]++;

	}

	ll sum=0;

	for(int i=1;i<=9;i++)

		sum+=ans[i];

	ans[0]=(h-2ll)*(w-2ll)-sum;

	for(int i=0;i<=9;i++)

		PF("%lld\n",ans[i]);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2717461954942924x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<cmath>

#include<vector>

#include<map>

#define SF scanf

#define PF printf

#define MAXN 15

using namespace std;

typedef long long ll;

int h,w,n;

int gx[10]={-2,-1,0};

int gy[10]={-2,-1,0};

map<pair<int,int> ,int> used;

ll ans[MAXN];

int main(){

	SF("%d%d",&h,&w);

	SF("%d",&n);

	for(int i=1;i<=n;i++){

		int x,y;

		SF("%d%d",&x,&y);

		for(int i=0;i<3;i++)

			for(int j=0;j<3;j++){

				int xx=x+gx[i];

				int yy=y+gy[j];

				if(xx<1||yy<1||xx+2>h||yy+2>w)

					continue;

				used[make_pair(xx,yy)]++;	

			}

	}

	map<pair<int,int>,int>::iterator it=used.begin();

	for(;it!=used.end();it++){

		ans[it->second]++;

	}

	ll sum=0;

	for(int i=1;i<=9;i++)

		sum+=ans[i];

	ans[0]=(h-2ll)*(w-2ll)-sum;

	for(int i=0;i<=9;i++)

		PF("%lld\n",ans[i]);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;



#define fi first

#define se second

long long ans[10], h, w, n;

pair<int, int> p[100010];

set<long long> candidate[10];



int main() {

    scanf("%lld%lld%lld", &h, &w, &n);

    for(int i = 0; i < n; i++) {

        scanf("%lld%lld", &p[i].fi, &p[i].se);

        p[i].fi--, p[i].se--;

    }

    sort(p, p + n);

    for(int i = 0; i < n; i++) {

        for(int dx = -2; dx <= 2; dx++) {

            for(int dy = -2; dy <= 2; dy++) {

                int x = p[i].fi + dx, y = p[i].se + dy, z = x + 2, t = y + 2;

                if(x < 0 || y < 0 || z >= h || t >= w) continue;

                int cnt = 0;

                for(int a = 0; a < 3; a++) {

                    for(int b = 0; b < 3; b++) {

                        int c = a + x, d = b + y, f = lower_bound(p, p + n, make_pair(c, d)) - p;

                        if(f < n && p[f].fi == c && p[f].se == d) cnt++;

                    }

                }

                candidate[cnt].insert(x*w + y);

            }

        }

    }

    for(int i = 1; i <= 9; i++) ans[i] = candidate[i].size();

    ans[0] = (h-2) * (w-2);

    for(int i = 1; i <= 9; i++) ans[0] -= ans[i];

    for(int i = 0; i <= 9; i++) printf("%lld\n", ans[i]);

}


// Faster C++ solution for the same problem (measured speedup: 1.1234363174454582x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

using namespace std;



typedef long long ll;



int n,m,q;

ll ans[10];

map<pair<int,int>,int> vis;



void add(int x,int y){

    if(x<2||y<2|x>n-1||y>m-1) return;

    //printf("#%d %d\n",x,y);

    vis[make_pair(x,y)]++;

}



int main(){

    scanf("%d%d%d",&n,&m,&q);

    ans[0]=1ll*(n-2)*(m-2);

    for(int s=1;s<=q;s++){

        int x,y;

        scanf("%d%d",&x,&y);

        add(x,y);

        for(int i=-1;i<=1;i++)

            if(i!=0) add(x+i,y),add(x,y+i);

        for(int i=-1;i<=1;i++)

            for(int j=-1;j<=1;j++)

                if(i!=0&&j!=0) add(x+i,y+j);

    }

    map<pair<int,int>,int>::iterator it;

    for(it=vis.begin();it!=vis.end();it++)

        ans[it->second]++,ans[0]--;

    for(int i=0;i<=9;i++)

        printf("%lld\n",ans[i]);

}
// Slower C++ solution:
#include <bits/stdc++.h>

using namespace std;

 

long long ans[15];

const int N = 1e6 + 10;

 

int main()

{

    long long h, w, node[N], inf = 1e9 + 7, n, a, b, cnt = 0;

    cin >> h >> w >> n;

    for(int i = 0; i < n; i++){

        cin >> a >> b;

        for(int i = -2; i <= 0; i++){

            for(int j = -2; j <= 0; j++){

                if(a + i >= 1 && b + j >= 1 && a + i <= h - 2 && b + j <= w - 2){

                    node[cnt] = inf * (a + i) + (b + j);

                    cnt++;

                }

            }

        }

    }

    sort(node, node + cnt);

    long long tmp = 1, zero = (h - 2) * (w - 2);

    for(int i = 0; i <= cnt - 1; i++){

        if(node[i + 1] == node[i]) tmp++;

        else{

            ans[tmp]++;

            tmp = 1;

            zero--;

        }

    }

    cout << zero << endl;

    for(int i = 1; i <= 9; i++) cout << ans[i] << endl;

}

// Faster C++ solution for the same problem (measured speedup: 1.2707928841594966x):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

using namespace std;



typedef long long ll;



int n,m,q;

ll ans[10];

map<pair<int,int>,int> vis;



void add(int x,int y){

    if(x<2||y<2|x>n-1||y>m-1) return;

    //printf("#%d %d\n",x,y);

    vis[make_pair(x,y)]++;

}



int main(){

    scanf("%d%d%d",&n,&m,&q);

    ans[0]=1ll*(n-2)*(m-2);

    for(int s=1;s<=q;s++){

        int x,y;

        scanf("%d%d",&x,&y);

        add(x,y);

        for(int i=-1;i<=1;i++)

            if(i!=0) add(x+i,y),add(x,y+i);

        for(int i=-1;i<=1;i++)

            for(int j=-1;j<=1;j++)

                if(i!=0&&j!=0) add(x+i,y+j);

    }

    map<pair<int,int>,int>::iterator it;

    for(it=vis.begin();it!=vis.end();it++)

        ans[it->second]++,ans[0]--;

    for(int i=0;i<=9;i++)

        printf("%lld\n",ans[i]);

}