stablegradients/pie-gem5-pairs huggingface dataset:
// 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.1079469665388413x):
#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]);

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 1.104698214973663x):
#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]);

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.1040008431521833x):
#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]);

}
// 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.1336521952217875x):
#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]);

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 1.1010496243328642x):
#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]);

}
// Slower C++ solution:
#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';

}

// Faster C++ solution for the same problem (measured speedup: 1.1015906208233257x):
#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]);

}
// 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.2823487370209405x):
#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]);

}
// 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.2126989933938803x):
#include<cstdio>

#include<iostream>

#include<cstring>

#include<algorithm>

#define RG register

#define LL long long

using namespace std;

const int N=9e5+10;

int n,cnt,num=1;

LL h,w,col[N],ans[12],zro;

template<typename I> inline void read(I &ot){

	I ch=getchar(), x=0, f=1;

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

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

	ot=x*f;}

template<typename I, typename... U> inline void read(I &x,U&... y){read(x); read(y...);}

int main()

{

//	freopen("Snuke's Coloring.in","r",stdin);

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

	read(h,w,n); zro=(h-2)*(w-2);

	for(int i=1,a,b;i<=n;i++)

	{

		read(a,b);

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

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

		  if(a+x>0 && a+x<=h-2 && b+y>0 && b+y<=w-2)

		   col[++cnt]=(a+x-1)*(w)+(b+y);

	}

	sort(col+1,col+cnt+1);

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

	 if(col[i]==col[i+1]) num++;

	 else ans[num]++, zro--, num=1;

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

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

	//fclose(stdin); fclose(stdout);

	return 0;

}
// Slower C++ solution:
#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;

}


// Faster C++ solution for the same problem (measured speedup: 4.97762215097592x):
#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;

}
// Slower C++ solution:
#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;

}

// Faster C++ solution for the same problem (measured speedup: 5.038493268086868x):
#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;

}
// Slower C++ solution:
#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]);

	}

}

// Faster C++ solution for the same problem (measured speedup: 4.67772840490181x):
#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;

}