Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

func rangeCheck(x, y int) bool {
	if x >= 0 && x <= 9 && y >= 0 && y <= 9 {
		return true
	} else {
		return false
	}
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	paper := make([][]int, 10)
	for i := range paper {
		paper[i] = make([]int, 10)
		for j := range paper[i] {
			paper[i][j] = 0
		}
	}
	fmt.Println(paper)
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), ",")
		x, _ := strconv.Atoi(infos[0])
		y, _ := strconv.Atoi(infos[1])
		s, _ := strconv.Atoi(infos[2])
		// fmt.Println(x, y, s)
		switch s {
		case 1:
			paper[x][y]++
			if rangeCheck(x, y-1) {
				paper[x][y-1]++
			}
			if rangeCheck(x, y+1) {
				paper[x][y+1]++
			}
			if rangeCheck(x-1, y) {
				paper[x-1][y]++
			}
			if rangeCheck(x+1, y) {
				paper[x+1][y]++
			}
			continue
		case 2:
			paper[x][y]++
			if rangeCheck(x-1, y-1) {
				paper[x-1][y-1]++
			}
			if rangeCheck(x, y-1) {
				paper[x][y-1]++
			}
			if rangeCheck(x+1, y-1) {
				paper[x+1][y-1]++
			}
			if rangeCheck(x-1, y) {
				paper[x-1][y]++
			}
			if rangeCheck(x+1, y) {
				paper[x+1][y]++
			}
			if rangeCheck(x-1, y+1) {
				paper[x-1][y+1]++
			}
			if rangeCheck(x, y+1) {
				paper[x][y+1]++
			}
			if rangeCheck(x+1, y+1) {
				paper[x+1][y+1]++
			}
			continue
		case 3:
			paper[x][y]++
			if rangeCheck(x-1,y-1) {
				paper[x-1][y-1]++
			}
			if rangeCheck(x,y-1) {
				paper[x][y-1]++
			}
			if rangeCheck(x+1,y-1) {
				paper[x+1][y-1]++
			}
			if rangeCheck(x-1,y) {
				paper[x-1][y]++
			}
			if rangeCheck(x+1,y) {
				paper[x+1][y]++
			}
			if rangeCheck(x-1,y+1) {
				paper[x-1][y+1]++
			}
			if rangeCheck(x,y+1) {
				paper[x][y+1]++
			}
			if rangeCheck(x+1,y+1) {
				paper[x+1][y+1]++
			}
			if rangeCheck(x,y-2) {
				paper[x][y-2]++
			}
			if rangeCheck(x-2,y) {
				paper[x-2][y]++
			}
			if rangeCheck(x+2,y) {
				paper[x+2][y]++
			}
			if rangeCheck(x,y+2) {
				paper[x][y+2]++
			}
			continue
		}
	}
	count := 0
	max := -1
	for i := range paper {
		for j := range paper[i] {
			if paper[i][j] == 0 {
				count++
			}
			if max >= paper[i][j] {
				max = max
			} else {
				max = paper[i][j]
			}
		}
	}
	fmt.Printf("%d\n%d", count, max)
}

C++: #include <iostream>
#include <vector>

using namespace std;
constexpr int paper_w=10,paper_h=10;
constexpr int ink_w=5,ink_h=5;
int inkarea[3][ink_h][ink_w]={
  0,0,0,0,0,
  0,0,1,0,0,
  0,1,1,1,0,
  0,0,1,0,0,
  0,0,0,0,0,

  0,0,0,0,0,
  0,1,1,1,0,
  0,1,1,1,0,
  0,1,1,1,0,
  0,0,0,0,0,

  0,0,1,0,0,
  0,1,1,1,0,
  1,1,1,1,1,
  0,1,1,1,0,
  0,0,1,0,0
};
int main(){
  int paper[paper_h][paper_w]={0};
  int x,y,size;
  char c;
  while(cin>>x>>c>>y>>c>>size){
    for(int i=0;i<ink_h;i++){
      for(int j=0;j<ink_w;j++){
        int ink_x=x+j-2,ink_y=y+i-2;
        if(ink_y<0||paper_h<=ink_y||ink_x<0||paper_w<=ink_x)
          continue;
        paper[ink_y][ink_x]+=inkarea[size-1][i][j];
      }
    }
    int white=0,density=0;
    for(int i=0;i<paper_h;i++){
      for(int j=0;j<paper_w;j++){
        if(!paper[i][j])
          white++;
        if(density<paper[i][j])
          density=paper[i][j];
      }
    }
    cout<<white<<endl;
    cout<<density<<endl;
  }
}

C++: #include <stdio.h>
#include <iostream>
#include <algorithm>
using namespace std;

inline bool check(int x, int y)
{
	if (x >= 0 && x <= 9 && 0 <= y && y <= 9) return true;
	else false;
}

int main()
{
	int mass[12][12] = { {0} };
	int x, y, s, non = 0, maxim = -1;

	while (scanf("%d,%d,%d", &x, &y, &s) != EOF)
	{
		switch (s)
		{
		case 1:
			mass[x][y]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			break;
		case 2:
			mass[x][y]++;
			if (check(x - 1, y - 1)) mass[x - 1][y - 1]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x + 1, y - 1)) mass[x + 1][y - 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			if (check(x - 1, y + 1)) mass[x - 1][y + 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x + 1, y + 1)) mass[x + 1][y + 1]++;
			break;
		case 3:
			mass[x][y]++;
			if (check(x - 1, y - 1)) mass[x - 1][y - 1]++;
			if (check(x, y - 1)) mass[x][y - 1]++;
			if (check(x + 1, y - 1)) mass[x + 1][y - 1]++;
			if (check(x - 1, y)) mass[x - 1][y]++;
			if (check(x + 1, y)) mass[x + 1][y]++;
			if (check(x - 1, y + 1)) mass[x - 1][y + 1]++;
			if (check(x, y + 1)) mass[x][y + 1]++;
			if (check(x + 1, y + 1)) mass[x + 1][y + 1]++;
			if (check(x, y - 2)) mass[x][y - 2]++;
			if (check(x - 2, y)) mass[x - 2][y]++;
			if (check(x + 2, y)) mass[x + 2][y]++;
			if (check(x, y + 2)) mass[x][y + 2]++;
			break;
		}
	}
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (mass[i][j] == 0) non++;
			maxim = max(maxim, mass[i][j]);
		}
	}
	cout << non << endl << maxim << endl;
	return 0;
}

C++: #include <iostream>

using namespace std;
 
int main(){
    int x,y,sz,f[13][13],cnt = 0,max = 0; 
    for(int i = 0 ; i < 13 ; i++){
	for(int j = 0 ; j < 13 ; j++){
	    f[i][j] = 0;
	}
    }
    while(cin >> x >> y >> sz){
	x += 2; y += 2;
	switch(sz){
	case 3:
	    f[x][y-2]++; f[x][y+2]++;
	    f[x-2][y]++; f[x+2][y]++;
	case 2:
	    f[x-1][y-1]++; f[x+1][y+1]++;
	    f[x-1][y+1]++; f[x+1][y-1]++;
	case 1:
	    f[x][y]++; f[x-1][y]++; f[x][y-1]++; 
	    f[x+1][y]++; f[x][y+1]++;
	    break;
	}
    }
 
    for(int i = 2 ; i < 12 ; i++){
	for(int j = 2 ; j < 12 ; j++){
	    if(max < f[i][j]) max = f[i][j];
	    if(f[i][j] == 0) cnt++;
	}
    }
    cout << cnt << "\n" << max << endl; 
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<vector>
using namespace std;
#define int long long
signed main(){
	int x,y,t;
	vector<vector<int>> v(14, vector<int>(14,0));
	while( scanf("%lld,%lld,%lld", &x, &y, &t) != EOF ){
		x+=2;
		y+=2;
		switch (t) {
			case 3:
				v[x][y-2]++;
				v[x][y+2]++;
				v[x-2][y]++;
				v[x+2][y]++;
			case 2:
				v[x-1][y-1]++;
				v[x-1][y+1]++;
				v[x+1][y-1]++;
				v[x+1][y+1]++;
			case 1:
				v[x+1][y]++;
				v[x-1][y]++;
				v[x][y-1]++;
				v[x][y+1]++;
				v[x][y]++;
				break;
		}
	}
	int z=0;
	int mx=-1;
	for(int i=2;i<12;i++){
		for(int j=2;j<12;j++){
			if(v[i][j]==0) z++;
			mx = max(mx, v[i][j]);
		}
	}
	cout << z << endl;
	cout << mx << endl;
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int dp[20][20];
int main(){
	for(int i=0;i<20;i++)
		for(int j=0;j<20;j++)
			dp[i][j]=-1;
	for(int i=5;i<15;i++)
		for(int j=5;j<15;j++)
			dp[i][j]=0;
	int x,y,s;
	char z;
	while(cin>>x>>z>>y>>z>>s){
		if(s==1){
			dp[x+5][y+5]++;
			if(dp[x-1+5][y+5]!=-1)
				dp[x-1+5][y+5]++;
			if(dp[x+1+5][y+5]!=-1)
				dp[x+1+5][y+5]++;
			if(dp[x+5][y-1+5]!=-1)
				dp[x+5][y-1+5]++;
			if(dp[x+5][y+1+5]!=-1)
				dp[x+5][y+1+5]++;
		}
		if(s==2){
			for(int i=x-1+5;i<=x+1+5;i++){
				for(int j=y-1+5;j<=y+1+5;j++){
					if(dp[i][j]!=-1)
						dp[i][j]++;
				}
			}
		}
		if(s==3){
			for(int i=x-1+5;i<=x+1+5;i++){
				for(int j=y-1+5;j<=y+1+5;j++){
					if(dp[i][j]!=-1)
						dp[i][j]++;
				}
			}
			if(dp[x-2+5][y+5]!=-1)
				dp[x-2+5][y+5]++;
			if(dp[x+2+5][y+5]!=-1)
				dp[x+2+5][y+5]++;
			if(dp[x+5][y-2+5]!=-1)
				dp[x+5][y-2+5]++;
			if(dp[x+5][y+2+5]!=-1)
				dp[x+5][y+2+5]++;
		}
		int max=1,zero=0;
		for(int i=0;i<20;i++){
			for(int j=0;j<20;j++){
				if(dp[i][j]>max)
					max=dp[i][j];
				if(dp[i][j]==0)
					zero++;
			}
		}
		cout<<zero<<endl;
		cout<<max<<endl;
	}
	return 0;
}