Language: C

<?php
class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}

function check($y, $x) {

}

$sc = new Scanner();
$H = $sc->nextInt();
$W = $sc->nextInt();
$N = $sc->nextInt();
$map = array();
$a = array();
$b = array();

for($i=0;$i<$N;$i++) {
	$a[] = $sc->nextInt();
	$b[] = $sc->nextInt();
	$map[$a[$i]."_".$b[$i]] = 1;
}

$taboo = array();

$ans = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

$dx = array(-1, 0, 1);
$dy = array(-1, 0, 1);

for($k=0;$k<$N;$k++) {
	//start($a[$i], $b[$i]);
	$yy = $a[$k];
	$xx = $b[$k];
	for($i=0;$i<3;$i++) {
		for($j=0;$j<3;$j++) {
			//check($y + $dy[$i], $x + $dx[$j]);
			$y = $yy + $dy[$i];
			$x = $xx + $dx[$j];
			if(isset($taboo[$y."_".$x])) continue;
			if($y <= 1 || $y >= $H || $x <= 1 || $x >= $W) continue;
			
			$taboo[$y."_".$x] = 1;
			//echo "check".$y.", ".$x."\n";
			$count = 0;
			for($ii=0;$ii<3;$ii++) {
				for($jj=0;$jj<3;$jj++) {
					if(isset($map[($y+$dy[$ii])."_".($x+$dx[$jj])])) {
						$count++;
					}
				}
			}
			
			$ans[$count]++;
		}
	}
}

$sum = 0;
for($i=1;$i<=9;$i++) {
	$sum += $ans[$i];
}

$ans[0] = ($H * $W) - (2 * $H + 2 * $W) + 4 - $sum;

for($i=0;$i<=9;$i++) {
	echo $ans[$i]."\n";
}

?>

Compiler output:
main.c:1:1: error: expected identifier or '(' before '<' token
    1 | <?php
      | ^
main.c:28:1: error: unknown type name 'function'; did you mean 'union'?
   28 | function check($y, $x) {
      | ^~~~~~~~
      | union
main.c: In function 'check':
main.c:28:10: error: type of '$y' defaults to 'int' [-Wimplicit-int]
   28 | function check($y, $x) {
      |          ^~~~~
main.c:28:10: error: type of '$x' defaults to 'int' [-Wimplicit-int]
main.c: At top level:
main.c:32:1: warning: data definition has no type or storage class
   32 | $sc = new Scanner();
      | ^~~
main.c:32:1: error: type defaults to 'int' in declaration of '$sc' [-Wimplicit-int]
main.c:32:7: error: 'new' undeclared here (not in a function)
   32 | $sc = new Scanner();
      |       ^~~
main.c:32:11: error: expected ',' or ';' before 'Scanner'
   32 | $sc = new Scanner();
      |           ^~~~~~~
main.c:33:1: warning: data definition has no type or storage class
   33 | $H = $sc->nextInt();
      | ^~
main.c:33:1: error: type defaults to 'int' in declaration of '$H' [-Wimplicit-int]
main.c:33:9: error: invalid type argument of '->' (have 'int')
   33 | $H = $sc->nextInt();
      |         ^~
main.c:34:1: warning: data definition has no type or storage class
   34 | $W = $sc->nextInt();
      | ^~
main.c:34:1: error: type defaults to 'int' in declaration of '$W' [-Wimplicit-int]
main.c:34:9: error: invalid type argument of '->' (have 'int')
   34 | $W = $sc->nextInt();
      |         ^~
main.c:35:1: warning: data definition has no type or storage class
   35 | $N = $sc->nextInt();
      | ^~
main.c:35:1: error: type defaults to 'int' in declaration of '$N' [-Wimplicit-int]
main.c:35:9: error: invalid type argument of '->' (have 'int')
   35 | $N = $sc->nextInt();
      |         ^~
main.c:36:1: warning: data definition has no type or storage class
   36 | $map = array();
      | ^~~~
main.c:36:1: error: type defaults to 'int' in declaration of '$map' [-Wimplicit-int]
main.c:36:8: error: implicit declaration of function 'array' [-Wimplicit-function-declaration]
   36 | $map = array();
      |        ^~~~~
main.c:36:8: error: initializer element is not constant
main.c:37:1: warning: data definition has no type or storage class
   37 | $a = array();
      | ^~
main.c:37:1: error: type defaults to 'int' in declaration of '$a' [-Wimplicit-int]
main.c:37:6: error: initializer element is not constant
   37 | $a = array();
      |      ^~~~~
main.c:38:1: warning: data definition has no type or storage class
   38 | $b = array();
      | ^~
main.c:38:1: error: type defaults to 'int' in declaration of '$b' [-Wimplicit-int]
main.c:38:6: error: initializer element is not constant
   38 | $b = array();
      |      ^~~~~
main.c:40:1: error: expected identifier or '(' before 'for'
   40 | for($i=0;$i<$N;$i++) {
      | ^~~
main.c:40:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   40 | for($i=0;$i<$N;$i++) {
      |            ^
main.c:40:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   40 | for($i=0;$i<$N;$i++) {
      |                  ^~
main.c:46:1: warning: data definition has no type or storage class
   46 | $taboo = array();
      | ^~~~~~
main.c:46:1: error: type defaults to 'int' in declaration of '$taboo' [-Wimplicit-int]
main.c:46:10: error: initializer element is not constant
   46 | $taboo = array();
      |          ^~~~~
main.c:48:1: warning: data definition has no type or storage class
   48 | $ans = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
      | ^~~~
main.c:48:1: error: type defaults to 'int' in declaration of '$ans' [-Wimplicit-int]
main.c:48:8: error: initializer element is not constant
   48 | $ans = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
      |        ^~~~~
main.c:50:1: warning: data definition has no type or storage class
   50 | $dx = array(-1, 0, 1);
      | ^~~
main.c:50:1: error: type defaults to 'int' in declaration of '$dx' [-Wimplicit-int]
main.c:50:7: error: initializer element is not constant
   50 | $dx = array(-1, 0, 1);
      |       ^~~~~
main.c:51:1: warning: data definition has no type or storage class
   51 | $dy = array(-1, 0, 1);
      | ^~~
main.c:51:1: error: type defaults to 'int' in declaration of '$dy' [-Wimplicit-int]
main.c:51:7: error: initializer element is not constant
   51 | $dy = array(-1, 0, 1);
      |       ^~~~~
main.c:53:1: error: expected identifier or '(' before 'for'
   53 | for($k=0;$k<$N;$k++) {
      | ^~~
main.c:53:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<' token
   53 | for($k=0;$k<$N;$k++) {
      |            ^
main.c:53:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   53 | for($k=0;$k<$N;$k++) {
      |                  ^~
main.c:81:1: warning: data definition has no type or storage class
   81 | $sum = 0;
      | ^~~~
main.c:81:1: error: type defaults to 'int' in declaration of '$sum' [-Wimplicit-int]
main.c:82:1: error: expected identifier or '(' before 'for'
   82 | for($i=1;$i<=9;$i++) {
      | ^~~
main.c:82:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   82 | for($i=1;$i<=9;$i++) {
      |            ^~
main.c:82:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   82 | for($i=1;$i<=9;$i++) {
      |                  ^~
main.c:86:1: warning: data definition has no type or storage class
   86 | $ans[0] = ($H * $W) - (2 * $H + 2 * $W) + 4 - $sum;
      | ^~~~
main.c:86:1: error: type defaults to 'int' in declaration of '$ans' [-Wimplicit-int]
main.c:86:1: error: conflicting types for '$ans'; have 'int[0]'
main.c:48:1: note: previous definition of '$ans' with type 'int'
   48 | $ans = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
      | ^~~~
main.c:88:1: error: expected identifier or '(' before 'for'
   88 | for($i=0;$i<=9;$i++) {
      | ^~~
main.c:88:12: error: expected '=', ',', ';', 'asm' or '__attribute__' before '<=' token
   88 | for($i=0;$i<=9;$i++) {
      |            ^~
main.c:88:18: error: expected '=', ',', ';', 'asm' or '__attribute__' before '++' token
   88 | for($i=0;$i<=9;$i++) {
      |                  ^~
main.c:92:1: error: expected identifier or '(' before '?' token
   92 | ?>
      | ^