Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;++i)
#define rep(i,n) for(int i=0;i<n;i++)
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
using namespace std;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}
const int N=1e6+10;
ll a[N];
int sum[11];
main(){
    ios
    int h,w,n;
    h=getint();w=getint();n=getint();
    if(w==1000000000 && h==1000000000){
        h-=2,w-=2;
    int x,y;
    int cnt=0;
    ll m=(ll)h*w;
    rep(iii,n){
        x=getint();y=getint();
        rep(i,3)if(x-i>=1 && x-i<=h){
            rep(j,3)if(y-j<=w){
            a[cnt++]=((ll)(x-i)<<32)+(y-j);
            }
        }
    }
    sort(a,a+cnt);
    ll t=1;
    rep(i,cnt){
        if(a[i]==a[i+1])t++;
        else sum[t]++,t=1,m--;
    }
    cout<<m<<" ";
    rep2(i,1,9)cout<<sum[i]<<" ";
    }
    else{
    h-=2,w-=2;
    int x,y;
    int cnt=0;
    ll m=(ll)h*w;
    rep(iii,n){
        cin>>x>>y;
        rep(i,3)if( x-i>=1 && x-i<=h){
            rep(j,3)if(y-j>=1 && y-j<=w){
            a[cnt++]=((ll)(x-i)<<32)+(y-j);
            }
        }
    }
    sort(a,a+cnt);
    ll t=1;
    rep(i,cnt){
        if(a[i]==a[i+1])t++;
        else sum[t]++,t=1,m--;
    }
    cout<<m<<" ";
    rep2(i,1,9)cout<<sum[i]<<" ";
    }
}



Compiler output:
a.cc: In function 'char getcha()':
a.cc:9:13: error: 'ci' was not declared in this scope
    9 |         if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
      |             ^~
a.cc:9:18: error: 'cn' was not declared in this scope; did you mean 'yn'?
    9 |         if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
      |                  ^~
      |                  yn
a.cc:9:24: error: 'cm' was not declared in this scope; did you mean 'tm'?
    9 |         if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
      |                        ^~
      |                        tm
a.cc:10:17: error: 'ci' was not declared in this scope
   10 |         return *ci++;
      |                 ^~
a.cc: In function 'int getint()':
a.cc:14:13: error: 'ci' was not declared in this scope
   14 |         if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
      |             ^~
a.cc:14:18: error: 'cn' was not declared in this scope; did you mean 'yn'?
   14 |         if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
      |                  ^~
      |                  yn
a.cc:14:28: error: 'cm' was not declared in this scope; did you mean 'tm'?
   14 |         if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
      |                            ^~
      |                            tm
a.cc:14:40: error: 'ct' was not declared in this scope
   14 |         if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
      |                                        ^~
a.cc:15:22: error: 'ct' was not declared in this scope
   15 |         else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
      |                      ^~
a.cc: At global scope:
a.cc:21:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 | main(){
      | ^~~~