stablegradients/pie-gem5-bysrc huggingface dataset:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



#define int long long

#define fi first

#define se second

typedef pair<int, int> ii;



set<ii> sett;

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



signed main () {

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

    cin >> h >> w >> n;

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

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

        sett.insert(ii(x, y) );

    }



    for (auto i : sett) {

        int x = i.fi, y = i.se;

        int l, r, t, d;

        l = max(1LL, y - 2);

        t = max(1LL, x - 2);

        r = min(w, y + 2);

        d = min(h, x + 2);

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

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

                int cnt = 0;

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

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

                        if(sett.count(ii(_j, _k) ) ) cnt ++;

                    }

                }

                ans[cnt] ++;

            }

        }

    }



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

    for (int i = 1; i < 10; ++i) ans[i] /= i, ans[0] -= ans[i];

    for (int i = 0; i < 10; ++i) cout << ans[i] << '\n';



    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>



#define maxn 100005



using namespace std;



inline long long getint()

{

	long long num=0,flag=1;char c;

	while((c=getchar())<48||c>57)if(c=='-')flag=-1;

	while(c>=48&&c<=57)num=num*10+c-48,c=getchar();

	return num*flag;

}



map<long long,int>M;



long long num[10];

long long H,W,n;

long long a[maxn],b[maxn];



int main()

{

	H=getint(),W=getint(),n=getint();

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

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

	{

		a[i]=getint(),b[i]=getint();

		for(long long j=a[i]-2;j<=a[i];j++)for(long long k=b[i]-2;k<=b[i];k++)

		{

			if(j<1||k<1||j>H-2||k>W-2)continue;

			M[j*W+k]++;

		}

	}

	map<long long,int>::iterator iter;

	for(iter=M.begin();iter!=M.end();iter++)

	{

		num[iter->second]++;

		num[0]--;

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <bits/stdc++.h>

#include <time.h>

#include <tr1/unordered_map>

#include <tr1/unordered_set>

using namespace std::tr1;

using namespace std;

/* cau troi cho Garena nhap de con Bach */

#define FSYNC ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define fi first

#define se second

#define pb push_back

#define mp make_pair

#define int long long

#define endl '\n'

#define inf 0x3f3f3f3f

#define lb lower_bound

#define pob pop_back

#define ub upper_bound

#define ite ::iterator

#define db(x) {cout <<"#db " << x << endl;}

#define here() {cout <<"here \n";}

#define mod 1000000007

typedef pair<int,int> ii;

typedef vector<int> vi;

typedef vector<ii> vii;

typedef vector<vi> vvi;

const int MOD = 1e9 + 7;

const int _MOD = 998244353;

const int N = 1e5;

set<ii> plane;

set<ii> check;

int h,w,n;

int cnt[10];

signed main(){

	cin >> h >> w >> n;

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

		int a,b;

		cin >> a >> b;

		plane.insert(mp(a,b));

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

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

				if(a+i >= 2 && b+j >= 2 && a+i <= h - 1 && b+j <= w - 1) check.insert(mp(a+i,b+j));

	}

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

	

	for(ii point:check){

		int total = 0;

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

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

				total += plane.count(mp(point.fi + i,point.se + j));

		if(total){

			cnt[0]--;

			cnt[total]++;

		}

	}

	for(int i = 0 ; i < 10 ; i ++) cout << cnt[i] << endl;

	

	return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>



#define maxn 100005



using namespace std;



inline long long getint()

{

	long long num=0,flag=1;char c;

	while((c=getchar())<48||c>57)if(c=='-')flag=-1;

	while(c>=48&&c<=57)num=num*10+c-48,c=getchar();

	return num*flag;

}



map<long long,int>M;



long long num[10];

long long H,W,n;

long long a[maxn],b[maxn];



int main()

{

	H=getint(),W=getint(),n=getint();

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

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

	{

		a[i]=getint(),b[i]=getint();

		for(long long j=a[i]-2;j<=a[i];j++)for(long long k=b[i]-2;k<=b[i];k++)

		{

			if(j<1||k<1||j>H-2||k>W-2)continue;

			M[j*W+k]++;

		}

	}

	map<long long,int>::iterator iter;

	for(iter=M.begin();iter!=M.end();iter++)

	{

		num[iter->second]++;

		num[0]--;

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>



using namespace std;



typedef pair<int, int> ii;

map<ii, int> cnt;

set<ii> s;

set<ii>::iterator it;

long long ans[10];

int main(){

	long long h, w, n;

	cin >> h >> w >> n;

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

		long long x, y;

		cin >> x >> y;

		for(int j = max(1LL, x - 2); j <= min(x, h - 2); j++){

			for(int k = max(1LL, y - 2); k <= min(y, w - 2); k++){

				cnt[ii(j, k)]++;

				s.insert(ii(j, k));

			}

		}

	}

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

		ii t = *it;

		ans[cnt[t]]++;

	}

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

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

		ans[0] -= ans[i];

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

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<cmath>

#include<algorithm>

#include<map>



#define maxn 100005



using namespace std;



inline long long getint()

{

	long long num=0,flag=1;char c;

	while((c=getchar())<48||c>57)if(c=='-')flag=-1;

	while(c>=48&&c<=57)num=num*10+c-48,c=getchar();

	return num*flag;

}



map<long long,int>M;



long long num[10];

long long H,W,n;

long long a[maxn],b[maxn];



int main()

{

	H=getint(),W=getint(),n=getint();

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

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

	{

		a[i]=getint(),b[i]=getint();

		for(long long j=a[i]-2;j<=a[i];j++)for(long long k=b[i]-2;k<=b[i];k++)

		{

			if(j<1||k<1||j>H-2||k>W-2)continue;

			M[j*W+k]++;

		}

	}

	map<long long,int>::iterator iter;

	for(iter=M.begin();iter!=M.end();iter++)

	{

		num[iter->second]++;

		num[0]--;

	}

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

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#include <iostream>

#include <vector>

#include <stdio.h>

#include <string>

#include <algorithm>



#define int long long



using namespace std;



typedef vector<int> vi;



string s;

int n, w, h, z, inpa, inpb, inf = 1000000007;

vi a, res;



signed main()

{

    //freopen("inp.txt", "r", stdin);

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

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

    res.assign(10, 0);

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

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

    {

        scanf("%lld %lld", &inpa, &inpb);

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

        {

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

            {

                int aa = inpa - i, bb = inpb - j;

                if (aa > 0 && bb > 0 && aa <= h - 2 && bb <= w - 2)

                {

                    a.push_back(inf * (aa) + bb);

                }

            }

        }

    }

    sort(a.begin(), a.end());

    /*

    for(int i=0;i<a.size();i++)

    {

        cout << a[i] << " ";

    }

    cout << endl;

    */

    int num = 1;

    for (int i = 0; i < a.size(); i++)

    {

        if (a[i] == a[i + 1])

        {

            ++num;

        }

        else

        {

            ++res[num];

            --z;

            num = 1;

        }

    }

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

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

    {

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

    }

    return 0;

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<set>  

#include<map>  

#include<stack>  

#include<cstdio>  

#include<queue>  

#include<cmath>  

#include<vector>  

#include<cstring> 

#include<climits>  

#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;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<map>

using namespace std;

#define L 9

#define MAXN 10

long long H,W;

long long ans[MAXN+5];

long long N;

map<pair<int,int>,int> G;

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

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

void Init()

{

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

}

int main()

{

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

	Init();

	int x,y; 

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

	{

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

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

		{

			int a=x+xl[i],b=y+yl[i];

			if(a<=H&&a>=1&&b<=W&&b>=1)

			{

				int num=(++G[make_pair(a,b)]);

				if(a>=2&&a<=H-1&&b>=2&&b<=W-1)

				{

					ans[num]++;

					ans[num-1]--;

				}

			}

		}

	}

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

	{

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

	}

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int h,w,n;

int ab[3]={0,1,-1};

ll ans[12];

vector < pair<ll,ll> > x;

map < pair<ll,ll>,int > y;

map < pair<ll,ll>,bool > z;

int main()

{

	cin>>h>>w>>n;

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

	while(n--)

    {

        int a,b;

        cin>>a>>b;

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

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

                if(a+ab[i]>1&&a+ab[i]<h&&b+ab[j]>1&&b+ab[j]<w)

                {

                    x.push_back(pair<ll,ll>(a+ab[i],b+ab[j]));

                    y[pair<ll,ll>(a+ab[i],b+ab[j])]++;

                }

    }

    for(int i=0;i<x.size();i++)

        if(!z[pair<ll,ll>(x[i].first,x[i].second)])

        {

            ll a=x[i].first,b=x[i].second;

            ans[y[pair<ll,ll>(a,b)]]++;

            z[pair<ll,ll>(a,b)]=1;

            ans[0]--;

        }

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

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

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

using namespace std;

const int N=20;

typedef long long ll;

map<pair<int,int>,int>sum;

ll ans[N];

int n,m;

void Paint(int x,int y){

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

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

            int a=x+i,b=y+j;

            if(a<=1||b<=1||a>=n||b>=m)

                continue ;

            int p=sum[make_pair(a,b)];

            sum[make_pair(a,b)]++;

            ans[p]--;

            ans[p+1]++;

        }

}

int main()

{

    int k;

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

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

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

        int u,v;

        scanf("%d%d",&u,&v);

        Paint(u,v);

    }

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

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

}


// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<map>

#include<algorithm>

using namespace std;

long long ans[16],way[9][2]={{0,0},{1,0},{-1,0},{0,1},{0,-1},{1,1},{1,-1},{-1,1},{-1,-1}},H,W,a,b;

int n;

map<long long,int> ma;

int main()

{

	scanf("%lld%lld%d",&H,&W,&n);

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

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

	{

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

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

		{

			long long nea=a+way[j][0];

			long long neb=b+way[j][1];

			if(nea>=H||neb>=W||nea<2||neb<2) continue;

			ans[ma[nea*W+neb]]--;

			ans[++ma[nea*W+neb]]++;

		}

	}

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

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<map>

#include<algorithm>

using namespace std;

#define LL long long

typedef pair<int,int> PII;

map<PII,int>Q;

int ans[10],cnt;

int main()

{

	int n,m,k,u,v;

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

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

	{

		scanf("%d%d",&u,&v);

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

		{

			if(i+u<=0) continue;

			if(i+u>=n-1) break;

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

			{

				if(v+j<=0) continue;

				if(v+j>=m-1) break;

				Q[PII(i+u,j+v)]++;

			}

		}

	}

	for(map<PII,int>::iterator it=Q.begin();it!=Q.end();it++)

	{

		ans[it->second]++;

		cnt++;

	}

	LL tot=1LL*(n-2)*(m-2)-cnt;

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

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

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

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#include<cstdio>

#include<cstring>

#include<algorithm>

#include<map>

#include<set>

#define MAXN 100000

using namespace std;

typedef long long LL;

typedef pair<int,int> PII;

map<PII,bool> vis;

set<PII> exist;

int a[MAXN+5],b[MAXN+5];

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

LL ans[10]={};

int main()

{

	int H,W,N;

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

	scanf("%d",&N);

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

	{

		scanf("%d %d",&a[i],&b[i]);

		exist.insert(PII(a[i],b[i]));

	}

	LL tot=1LL*(1LL*H-2LL)*(1LL*W-2LL);

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

	{

		int bgx,bgy;

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

		{

			bgx=a[i]+dir[p][0];

			bgy=b[i]+dir[p][1];

			if(bgx<=0||bgy<=0||bgx>H||bgy>W)

				continue;

			if(bgx+2<=0||bgy+2<=0||bgx+2>H||bgy+2>W)

				continue;

			if(vis[PII(bgx,bgy)]==true)

				continue;

			LL cnt=0;

			for(int x=bgx;x<=bgx+2;x++)

				for(int y=bgy;y<=bgy+2;y++)

				{

					if(exist.find(PII(x,y))!=exist.end())

						cnt+=1LL;

				}

			vis[PII(bgx,bgy)]=true;

			ans[cnt]+=1LL;

		}

	}

	ans[0]+=tot-vis.size();

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

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

	return 0;

}

// Optimized solution to the same problem (faster):
#include<cstdio>

#include<cstring>

#include<algorithm>

using namespace std;

#define ll long long

int H,W,N;

ll arr[1000005];

ll ans[10];

ll d=1e9+7;

int main()

{

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

    int x,y;

    int xx,yy;

    int count=0;

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

    {

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

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

       {

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

           {

               xx=x+i;

               yy=y+j;

               if(xx>1&&xx<H&&yy>1&&yy<W)

                    arr[count++]=xx*d+yy;

           }

       }

    }

    sort(arr,arr+count);

    int c=1;

    ll z=(ll)(H-2)*(ll)(W-2);

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

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

    {

        if(arr[i]==arr[i+1])

            c++;

        else

        {

            z--;

            ans[c]++;

            c=1;

        }

    }

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

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

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

    return 0;

}


// Fastest known solution for this problem: