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\n", count, max)
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int dec[10][10];
  int x,y,size,num,max;
  char a;
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
       dec[i][j]=0;
    }
  }
                
  while(cin >> y >> a>> x>> a>> size){
  if(size == 1){
    if(x+1<10) dec[x+1][y] += 1;
    if(x-1>=0) dec[x-1][y] += 1;
    if(y+1<10) dec[x][y+1] += 1;
    if(x-1>=0) dec[x][y-1] += 1;
      dec[x][y] += 1;
    } else if(size == 2){
      for(int i=-1;i<=1;i++){
	for(int j=-1;j<=1;j++){
	  if(x+i >=0&& x+i<10 && y+j>=0&& y+j<10) dec[x+i][y+j] +=1;
	}
      }
    }else if(size==3){
      for(int i=-1;i<=1;i++){
	for(int j=-1;j<=1;j++){
	  if(x+i >=0&& x+i<10 && y+j>=0&& y+j<10)  dec[x+i][y+j] +=1;
	}
      }
      if(x+2<10)dec[x+2][y] +=1;
      if(x-2>=0)dec[x-2][y] +=1;
      if(y+2<10)dec[x][y+2] +=1;
      if(y-2>=0)dec[x][y-2] +=1;
    }
  }
  max = dec[0][0];
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){ 
      if(dec[i][j]==0)
	num +=1; 
      if(max < dec[i][j])
	max=dec[i][j];
    }
  }
  cout << num << endl << max<<endl;
}

C++: #include <iostream>
#include <fstream>
#include <algorithm>
#include <vector>
#include <string>
#include <functional>
#include <array>
#include <stack>
#include <queue>
#include <chrono>
#include <numeric>
#include <memory.h>
#include <map>
#include <math.h>
#include <utility>
#include <set>

#pragma warning(disable:4996)
using namespace std;
#define REP(i,n) for(int i = 0 ; i < n ; ++i)
typedef long long Int;
const double PI = 3.141592653589793238;
const Int INF = 999999999999;
typedef pair<int, int> P;

int S[3][3] = {
		{ 0, 1, 0 },
		{ 1, 1, 1 },
		{ 0, 1, 0 },
};
int M[3][3] = {
		{ 1, 1, 1 },
		{ 1, 1, 1 },
		{ 1, 1, 1 },
};
int L[5][5] = {
		{ 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 tile[10][10];

int main()
{
	int x, y, size;
	while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
		int a = 0;
		int b = 0;
		int a_ = 0;
		int b_ = 0;
		if (size == 1){
			while (x + a - 1 < 0)++a;
			while (y + b - 1 < 0)++b;
			while (x + 2 + a_ > 10)--a_;
			while (y + 2 + b_ > 10)--b_;

			for (int i = y - 1 + b; i < y + 2 + b_; ++i){
				for (int j = x - 1 + a; j < x + 2 + a_; ++j){
					tile[i][j] += S[i + 1 - y ][j + 1 - x];
				}
			}
		}
		if (size == 2){
			while (x + a - 1 < 0)++a;
			while (y + b - 1 < 0)++b;
			while (x + 2 + a_ > 10)--a_;
			while (y + 2 + b_ > 10)--b_;

			for (int i = y - 1 + b; i < y + 2 + b_; ++i){
				for (int j = x - 1 + a; j < x + 2 + a_; ++j){
					tile[i][j] += M[i + 1 - y ][j + 1 - x ];
				}
			}
		}
		if (size == 3){
			while (x + a - 2 < 0)++a;
			while (y + b - 2 < 0)++b;
			while (x + 3 + a_ > 10)--a_;
			while (y + 3 + b_ > 10)--b_;

			for (int i = y - 2 + b; i < y + 3 + b_; ++i){
				for (int j = x - 2 + a; j < x + 3 + a_; ++j){
					tile[i][j] += L[i + 2 - y ][j + 2 - x ];
				}
			}
		}

		int white = 0;
		int max_ = -1;

		REP(i, 10){
			REP(j, 10){
				if (!tile[i][j])
					++white;
				max_ = max(tile[i][j], max_);
			}
		}

		cout << white << endl << max_ << endl;
	}
	return 0;

}

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<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<utility>
#include<string>

using namespace std;

int si[4]={0,5,9,13};
int dxl[13]={0,-1,0,1,-2,-1,0,1,2,-1,0,1,0};
int dyl[13]={2,1,1,1,0,0,0,0,0,-1,-1,-1,-2};
int dxm[9]={-1,0,1,-1,0,1,-1,0,1};
int dym[9]={1,1,1,0,0,0,-1,-1,-1};
int dxs[5]={0,-1,0,1,0};
int dys[5]={1,0,0,0,-1};

int p[10][10];

main(){
  int x,y,b,i,j;
  int noi=0,maxi=0;
  while(scanf("%d,%d,%d",&x,&y,&b)!=EOF){
    if(b==1){
      for(i=0;i<5;i++){
	if(0<=x+dxs[i] && x+dxs[i]<10 && 0<=y+dys[i] && y+dys[i]<10) p[x+dxs[i]][y+dys[i]]++;
      }
    }
    if(b==2){
      for(i=0;i<9;i++){
	if(0<=x+dxm[i] && x+dxm[i]<10 && 0<=y+dym[i] && y+dym[i]<10) p[x+dxm[i]][y+dym[i]]++;
      }
    }
    if(b==3){
      for(i=0;i<13;i++){
	if(0<=x+dxl[i] && x+dxl[i]<10 && 0<=y+dyl[i] && y+dyl[i]<10) p[x+dxl[i]][y+dyl[i]]++;
      }
    }
  }
  for(i=0;i<10;i++){
    for(j=0;j<10;j++){
      if(p[i][j]==0) noi++;
      else if(p[i][j] > maxi) maxi=p[i][j];
    }
  }
  cout << noi << endl << maxi << endl;
}