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

using namespace std;



int h, w, n;

map<pair<int,int> ,int> mp;

set<pair<int,int> > s[10];



void add(int x,int y) {

	int lx = max(1, x - 2), ly = max(1, y - 2);

	int rx = min(x, h - 2), ry = min(y, w - 2);

	for (x = lx; x <= rx; ++x) {

		for (y = ly; y <= ry; ++y) {

			if (mp[{x, y}]) s[mp[{x, y}]].erase({x, y});

			mp[{x, y}]++;

			s[mp[{x, y}]].insert({x, y});

		}

	}

}



int main() {

	ios_base::sync_with_stdio(false);

	cin >> h >> w >> n;

	while (n--) {

		int x, y; cin >> x >> y;

		add(x, y);

	}

	long long sum = 1LL * (h - 2) * (w - 2);

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

		sum -= (int)s[i].size();

	}

	cout << sum << '\n';

	for (int i = 1; i <= 9; ++i) cout << (int)s[i].size() << '\n';

}

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

#include<cstdio>

using namespace std;



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

#define MAXN 100000

int H,W,N;

long long Ans[10];

int A[MAXN+5],B[MAXN+5];

set<pair<int,int> > S1,S2;



int main(){

    scanf("%d%d%d",&H,&W,&N);

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

        scanf("%d%d",&A[i],&B[i]);

        S1.insert(make_pair(A[i],B[i]));

    }

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

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

            int x=A[i]+dir[j][0],y=B[i]+dir[j][1],cnt=0;

            if(x<1||x+2>H||y<1||y+2>W)

                continue;

            if(S2.count(make_pair(x,y)))

                continue;

            S2.insert(make_pair(x,y));

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

                cnt+=S1.count(make_pair(x-dir[k][0],y-dir[k][1]));

            Ans[cnt]++;

        }

    }

    long long tot=0;

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

        tot+=Ans[i];

    printf("%lld",(H-2ll)*(W-2ll)-tot);

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

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

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



using namespace std;



int h, w;

int n;



int a[100005], b[100005];

long long c[10];

#define x first

#define y second

signed main() {

    ios::sync_with_stdio(false); cin.tie(0);

    cin >> h >> w >> n;

    memset(c, 0ll, sizeof c);

    set< pair<int, int> > av;

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

        cin >> a[i] >> b[i];

        av.insert({a[i], b[i]});

    }

    set< pair<int, int> > canxet;

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

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

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

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

                    canxet.insert({a[i]+j, b[i]+k});

                }

            }

        }

    }

    for (set< pair<int, int> >::iterator i = canxet.begin(); i != canxet.end(); i++) {

        int cnt = 0;

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

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

                if (av.find({(*i).x + j, (*i).y + k}) != av.end()) cnt++;

            }

        }

        c[cnt]++;

    }

    c[0] = 1ll*(w-2)*(h-2);

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

        c[0] -= c[i];

    }

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

        cout << c[i] << endl;

    }

}


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

#include<cstdio>

using namespace std;



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

#define MAXN 100000

int H,W,N;

long long Ans[10];

int A[MAXN+5],B[MAXN+5];

set<pair<int,int> > S1,S2;



int main(){

    scanf("%d%d%d",&H,&W,&N);

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

        scanf("%d%d",&A[i],&B[i]);

        S1.insert(make_pair(A[i],B[i]));

    }

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

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

            int x=A[i]+dir[j][0],y=B[i]+dir[j][1],cnt=0;

            if(x<1||x+2>H||y<1||y+2>W)

                continue;

            if(S2.count(make_pair(x,y)))

                continue;

            S2.insert(make_pair(x,y));

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

                cnt+=S1.count(make_pair(x-dir[k][0],y-dir[k][1]));

            Ans[cnt]++;

        }

    }

    long long tot=0;

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

        tot+=Ans[i];

    printf("%lld",(H-2ll)*(W-2ll)-tot);

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

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

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

using namespace std;



int h, w, n;

map<pair<int,int> ,int> mp;

set<pair<int,int> > s[10];



void add(int x,int y) {

	int lx = max(1, x - 2), ly = max(1, y - 2);

	int rx = min(x, h - 2), ry = min(y, w - 2);

	for (x = lx; x <= rx; ++x) {

		for (y = ly; y <= ry; ++y) {

			if (mp[{x, y}]) s[mp[{x, y}]].erase({x, y});

			mp[{x, y}]++;

			s[mp[{x, y}]].insert({x, y});

		}

	}

}



int main() {

	ios_base::sync_with_stdio(false);

	cin >> h >> w >> n;

	while (n--) {

		int x, y; cin >> x >> y;

		add(x, y);

	}

	long long sum = 1LL * (h - 2) * (w - 2);

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

		sum -= (int)s[i].size();

	}

	cout << sum << '\n';

	for (int i = 1; i <= 9; ++i) cout << (int)s[i].size() << '\n';

}

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

#include<set>

#include<map>

#include<vector>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int H,W,N;

set<pair<int,int> > ans[10],blk;

pair<int,int> P[MAXN];



int Count(pair<int,int> R)

{

	int cnt=0;

	for(int i=R.first;i<R.first+3;i++)

		for(int j=R.second;j<R.second+3;j++)

			cnt+=blk.count(make_pair(i,j));

	return cnt;

}



int main()

{

	scanf("%d%d%d",&H,&W,&N);

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

	{

		scanf("%d%d",&P[i].first,&P[i].second);

		if(!blk.count(P[i]))

			blk.insert(P[i]);

	}

	

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

	{

		for(int x=max(P[i].first-2,1);x<=P[i].first&&x+2<=H;x++)

			for(int y=max(P[i].second-2,1);y<=P[i].second&&y+2<=W;y++)

			{

				pair<int,int> r=make_pair(x,y);

				int c=Count(r);

				ans[c].insert(r);

			}

	}

	long long ans0=(1LL*(W-2)*(H-2));

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

		ans0-=ans[i].size();

	printf("%lld\n",ans0);

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

		printf("%u\n",ans[i].size());

	

	return 0;

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



using namespace std;



int h, w;

int n;



int a[100005], b[100005];

long long c[10];

#define x first

#define y second

signed main() {

    ios::sync_with_stdio(false); cin.tie(0);

    cin >> h >> w >> n;

    memset(c, 0ll, sizeof c);

    set< pair<int, int> > av;

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

        cin >> a[i] >> b[i];

        av.insert({a[i], b[i]});

    }

    set< pair<int, int> > canxet;

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

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

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

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

                    canxet.insert({a[i]+j, b[i]+k});

                }

            }

        }

    }

    for (set< pair<int, int> >::iterator i = canxet.begin(); i != canxet.end(); i++) {

        int cnt = 0;

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

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

                if (av.find({(*i).x + j, (*i).y + k}) != av.end()) cnt++;

            }

        }

        c[cnt]++;

    }

    c[0] = 1ll*(w-2)*(h-2);

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

        c[0] -= c[i];

    }

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

        cout << c[i] << endl;

    }

}


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

#include<set>

#include<map>

#include<vector>

#include<algorithm>

using namespace std;

const int MAXN=100005;



int H,W,N;

set<pair<int,int> > ans[10],blk;

pair<int,int> P[MAXN];



int Count(pair<int,int> R)

{

	int cnt=0;

	for(int i=R.first;i<R.first+3;i++)

		for(int j=R.second;j<R.second+3;j++)

			cnt+=blk.count(make_pair(i,j));

	return cnt;

}



int main()

{

	scanf("%d%d%d",&H,&W,&N);

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

	{

		scanf("%d%d",&P[i].first,&P[i].second);

		if(!blk.count(P[i]))

			blk.insert(P[i]);

	}

	

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

	{

		for(int x=max(P[i].first-2,1);x<=P[i].first&&x+2<=H;x++)

			for(int y=max(P[i].second-2,1);y<=P[i].second&&y+2<=W;y++)

			{

				pair<int,int> r=make_pair(x,y);

				int c=Count(r);

				ans[c].insert(r);

			}

	}

	long long ans0=(1LL*(W-2)*(H-2));

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

		ans0-=ans[i].size();

	printf("%lld\n",ans0);

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

		printf("%u\n",ans[i].size());

	

	return 0;

}
// Slower C++ solution:
//In the name of God

#include<bits/stdc++.h>



using namespace std;

typedef long long ll;

typedef pair<int , int> pii;



const int N = 1e5 + 10;



map<pii , bool> block , mark;

ll res[10] , h , w;

int n , a[N] , b[N] , cnt;



void check(int x , int y){

        if(x <= 1 || x >= h || y <= 1 || y >= w || mark[{x,y}])

                return;

        int now = 0; 

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

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

                                now += (block[{x+dx , y+dy}] == 1);

        res[now]++;

        mark[{x,y}] = 1;

        cnt++;

}



int main(){

        ios_base::sync_with_stdio(false);

        cin.tie(0);

        cout.tie(0);

        cin >> h >> w >> n; 

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

                cin >> a[i] >> b[i];

                block[{a[i],b[i]}] = 1;

        }

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

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

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

                                check(a[i] + dx , b[i] + dy);

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

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

                cout << res[i] << "\n";

        return 0;

}

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

#include <algorithm>

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];

int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

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

#define int long long



using namespace std;

typedef pair<int,int> ii;

map<ii,int> mp;

set<ii> s;

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

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

int ans[10];



signed main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    int n,m,q;

    cin>>n>>m>>q;



    while(q--)

    {

        int x,y;

        cin>>x>>y;



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

        {

            if(x+dx[i]<1||x+dx[i]>n-2)

                continue;

            if(y+dy[i]<1||y+dy[i]>m-2)

                continue;

            mp[ii(x+dx[i],y+dy[i])] ++;

            s.insert(ii(x+dx[i],y+dy[i]));

        }

    }



    long long res = (n-2)*(m-2);

    for(auto it:s)

    {

        int x = it.first;

        int y = it.second;

        //cout<<x<<" "<<y<<" = "<<mp[ii(x,y)]<<'\n';



        ans[mp[ii(x,y)]]++;

        res --;

    }



    ans[0] = res;

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

        cout<<ans[i]<<'\n';

}


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

#include <algorithm>

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];

int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

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

using namespace std;

long long h,w,n,a,b,s[1000010],dem,kq[20];

const long long d=1e9+7;

int main()

{

	cin>>h>>w>>n;

	dem=0;

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

	 {

	 	cin>>a>>b;

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

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

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

			    {

			     dem++;

			     s[dem]=d*(a+j)+(b+o);

			    }

     }

    sort(s+1,s+1+dem);

    long long t,ti;

    t=(h-2)*(w-2);

    ti=1;

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

      if(s[i]==s[i+1]) ti++;

        else kq[ti]++,ti=1;

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

      t=t-kq[i];

	cout<<t<<endl;

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

	   cout<<kq[i]<<endl;

}

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

#include <algorithm>

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];

int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

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

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];



int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

}

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

#include <algorithm>

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];

int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

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

using namespace std;



#define ll long long

ll ans[11];

ll h,w,n;

const long inf=1e9+7, maxn=1e5*9+1;

	ll node[maxn];





int main()

{

	cin>>h>>w>>n;

	ll zero=(h-2)*(w-2);

	ll cnt=0;

	while(n--)

	{

		ll a, b; cin>>a>>b;

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

		{

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

			{

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

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

			}

		}

	}

	

	sort(node, node+cnt);

	for(ll i=0, tmp=1;i<cnt;i++)

	{

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

		else

		{

			zero--;

			ans[tmp]++;

			tmp=1;

		}

	}

	cout<<zero<<endl;

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

	{

		cout<<ans[i]<<endl;

	}

}

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

#include <algorithm>

using namespace std;

const int maxn=1e6+10,inf=1e9+7;

typedef long long ll;

ll h,w,node[maxn],n,a,b,cnt=0,zero,ans[15];

int main(){

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

    zero=(h-2)*(w-2);

    while(n--){

        scanf("%lld%lld",&a,&b);

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

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

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

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

                }

            }

        }

    }

    sort(node,node+cnt);

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

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

        else ans[tmp]++,zero--,tmp=1;

    }

    printf("%lld\n",zero);

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

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

    return 0;

}
// Slower C++ solution:
//In the name of God

#include<bits/stdc++.h>



using namespace std;

typedef long long ll;

typedef pair<int , int> pii;



const int N = 1e5 + 10;



map<pii , bool> block , mark;

ll res[10] , h , w;

int n , a[N] , b[N] , cnt;



void check(int x , int y){

        if(x <= 1 || x >= h || y <= 1 || y >= w || mark[{x,y}])

                return;

        int now = 0; 

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

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

                                now += (block[{x+dx , y+dy}] == 1);

        res[now]++;

        mark[{x,y}] = 1;

        cnt++;

}



int main(){

        ios_base::sync_with_stdio(false);

        cin.tie(0);

        cout.tie(0);

        cin >> h >> w >> n; 

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

                cin >> a[i] >> b[i];

                block[{a[i],b[i]}] = 1;

        }

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

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

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

                                check(a[i] + dx , b[i] + dy);

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

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

                cout << res[i] << "\n";

        return 0;

}

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

#include<map>

#include<algorithm>

using namespace std;

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

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

long long Ans[10+2];

int N,M,K;

map<pair<int,int>,long long> P;

int main() {

	#ifdef LOACL

	freopen("in.txt","r",stdin);

	freopen("out.txt","w",stdout);

	#endif

	scanf("%d %d %d",&N,&M,&K);

	Ans[0]=1LL*(N-2)*(M-2);

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

		int x,y;

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

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

			int tx=x+dx[j],ty=y+dy[j];

			if(tx<1||tx>N-2||ty<1||ty>M-2)

				continue;

			P[make_pair(tx,ty)]++;

		}

	}

	for(map<pair<int,int>,long long>::iterator it=P.begin();it!=P.end();it++) {

		Ans[0]--;

		Ans[it->second]++;

	}

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

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

	return 0;

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

#define int long long



using namespace std;

typedef pair<int,int> ii;

map<ii,int> mp;

set<ii> s;

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

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

int ans[10];



signed main()

{

    ios_base::sync_with_stdio(false);

    cin.tie(0); cout.tie(0);



    int n,m,q;

    cin>>n>>m>>q;



    while(q--)

    {

        int x,y;

        cin>>x>>y;



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

        {

            if(x+dx[i]<1||x+dx[i]>n-2)

                continue;

            if(y+dy[i]<1||y+dy[i]>m-2)

                continue;

            mp[ii(x+dx[i],y+dy[i])] ++;

            s.insert(ii(x+dx[i],y+dy[i]));

        }

    }



    long long res = (n-2)*(m-2);

    for(auto it:s)

    {

        int x = it.first;

        int y = it.second;

        //cout<<x<<" "<<y<<" = "<<mp[ii(x,y)]<<'\n';



        ans[mp[ii(x,y)]]++;

        res --;

    }



    ans[0] = res;

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

        cout<<ans[i]<<'\n';

}


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

#include<map>

#include<algorithm>

using namespace std;

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

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

long long Ans[10+2];

int N,M,K;

map<pair<int,int>,long long> P;

int main() {

	#ifdef LOACL

	freopen("in.txt","r",stdin);

	freopen("out.txt","w",stdout);

	#endif

	scanf("%d %d %d",&N,&M,&K);

	Ans[0]=1LL*(N-2)*(M-2);

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

		int x,y;

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

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

			int tx=x+dx[j],ty=y+dy[j];

			if(tx<1||tx>N-2||ty<1||ty>M-2)

				continue;

			P[make_pair(tx,ty)]++;

		}

	}

	for(map<pair<int,int>,long long>::iterator it=P.begin();it!=P.end();it++) {

		Ans[0]--;

		Ans[it->second]++;

	}

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

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

	return 0;

}
// Slower C++ solution:
//In the name of God

#include<bits/stdc++.h>



using namespace std;

typedef long long ll;

typedef pair<int , int> pii;



const int N = 1e5 + 10;



map<pii , bool> block , mark;

ll res[10] , h , w;

int n , a[N] , b[N] , cnt;



void check(int x , int y){

        if(x <= 1 || x >= h || y <= 1 || y >= w || mark[{x,y}])

                return;

        int now = 0; 

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

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

                                now += (block[{x+dx , y+dy}] == 1);

        res[now]++;

        mark[{x,y}] = 1;

        cnt++;

}



int main(){

        ios_base::sync_with_stdio(false);

        cin.tie(0);

        cout.tie(0);

        cin >> h >> w >> n; 

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

                cin >> a[i] >> b[i];

                block[{a[i],b[i]}] = 1;

        }

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

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

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

                                check(a[i] + dx , b[i] + dy);

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

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

                cout << res[i] << "\n";

        return 0;

}

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

#include <cstdio>

const int MAXN=1E5+10;

const int lr[]={-1,-1,-1,0,0,0,1,1,1};

const int ud[]={-1,0,1,-1,0,1,-1,0,1};

struct pair {

	int x,y;

	pair(int a=0,int b=0) {x=a;y=b;}

	bool operator < (const pair&c) const {

		return x<c.x ||( x==c.x&&y<c.y);

	}

};

std::set<pair>point,tang;

int x[MAXN],y[MAXN];

long long w[10];

int main() {

	int N,H,W;

	scanf("%d%d%d",&H,&W,&N);

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

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

		point.insert(pair(x[i],y[i]));

	}

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

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

			int xx=x[i]+ud[aa];

			int yy=y[i]+lr[aa];

			if(xx-1<1||xx+1>H||yy-1<1||yy+1>W)

				continue;

			if(tang.count(pair(xx,yy))!=0)

				continue;

			tang.insert(pair(xx,yy));

			int cnt=0;

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

				int xxx=xx+ud[bb];

				int yyy=yy+lr[bb];

				cnt+=point.count(pair(xxx,yyy));

			}w[cnt]++;

		}

	}long long rs=0;

	for(int i=1;i<=9;++i)rs+=w[i];

	w[0]=1ll*(H-2)*(W-2)-rs;

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

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

	}return 0;

}