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

int main(){int h,b,i,j;std::string r,a;while(std::cin>>r>>a,r!="0"&&a!="0"){h=b=i=0;for(;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])i==j?h++:b++;printf("%d %d\n",h,b);}}

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

int main(){int h,b,i,j;char r[5],a[5];while(scanf("%s%s",r,a),r[1]!='\0'&&a[1]!='\0'){for(h=b=i=0;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])i==j?h++:b++;printf("%d %d\n",h,b);}}

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

int main(){int h,b,i,j;std::string r,a;while(std::cin>>r>>a,r!="0"&&a!="0"){for(h=b=i=0;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])i==j?h++:b++;printf("%d %d\n",h,b);}}

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

int main(){int h,b,i,j;char r[5],a[5];while(scanf("%s%s",r,a),r[1]!='\0'&&a[1]!='\0'){for(h=b=i=0;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])i==j?h++:b++;printf("%d %d\n",h,b);}}

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

int main(){int f[2],i,j;std::string r,a;while(std::cin>>r>>a,r!="0"&&a!="0"){for(f[0]=f[1]=i=0;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])f[i!=j]++;printf("%d %d\n",f[0],f[1]);}}

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

int main(){int h,b,i,j;char r[5],a[5];while(scanf("%s%s",r,a),r[1]!='\0'&&a[1]!='\0'){for(h=b=i=0;i<4;i++)for(j=4;j-->0;)if(a[i]==r[j])i==j?h++:b++;printf("%d %d\n",h,b);}}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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';

}

// Optimized solution to the same problem (faster):
#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]);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

    }

}


// Optimized solution to the same problem (faster):
#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]);

}


// Fastest known solution for this problem:
// Original C++ solution (slower):
//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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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';

}


// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

	}

}

// Optimized solution to the same problem (faster):
#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;

}

// Fastest known solution for this problem:
// Original C++ solution (slower):
#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;

}

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



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;

}

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



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

}


// 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>

#define MOD 1000000007

#define INF 1061109567

#define int long long

#define pb push_back

#define in(s) freopen(s,"r",stdin);

#define out(s) freopen(s,"w",stdout);

#define fi first

#define se second

#define bw(i,r,l) for (int i=r-1;i>=l;i--)

#define fw(i,l,r) for (int i=l;i<r;i++)

#define fa(i,x) for (auto i:x)

using namespace std;

typedef pair<int,int> ii;

const int N=1e5+5;

int h,w,n,a[N],b[N],ans[15];

map<ii,int> mp;

void add(int x,int y) {

	int lx=max(1LL,x-2),ly=max(1LL,y-2),rx=min(x,h-2LL),ry=min(y,w-2LL);

	fw (i,lx,rx+1) {

		fw (j,ly,ry+1) {

			ans[mp[ii(i,j)]]--;

			mp[ii(i,j)]++;

			ans[mp[ii(i,j)]]++;

		}

	}

}

signed main() {

	//in("aome.inp");

	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

	cin>>h>>w>>n;

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

	fw (i,0,n) {

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

		add(a[i],b[i]);

	}

	/*

	For each newly added a[i], b[i] black spot, check all rectangles it affected.

	Starting: There are (H - 2) * (W - 2) 0 - spot rectangles

	cnt[i, j] stores all up - left corners of affected rectangles up to this point.

	If an affected rectangle haven't appeared yet, it's set to 1. Else, it's added up

	*/

	fw (i,0,10) 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: