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 <algorithm>
#include <cstdio>
#define MAX 30
using namespace std;


int main()
{
	int p[MAX][MAX];
	for (int i = 0; i < MAX; i++){
		for (int j = 0; j < MAX; j++){
			p[i][j] = 0;
		}
	}
	int x, y, size;
	while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
		x += 10;
		y += 10;
		p[x][y]++;
		p[x - 1][y]++;
		p[x + 1][y]++;
		p[x][y - 1]++;
		p[x][y + 1]++;
		if (size == 1){
			continue;
		}
		p[x - 1][y - 1]++;
		p[x - 1][y + 1]++;
		p[x + 1][y - 1]++;
		p[x + 1][y + 1]++;
		if (size == 2){
			continue;
		}
		p[x - 2][y]++;
		p[x + 2][y]++;
		p[x][y - 2]++;
		p[x][y + 2]++;
	}
	int clean = 0, ink = 0;
	for (int i = 10; i < 20; i++){
		for (int j = 10; j < 20; j++){
			if (p[i][j] == 0){
				clean++;
			}
			ink = max(ink, p[i][j]);
		}
	}
	cout << clean << endl;
	cout << ink << endl;

	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;

int main(){
  int x[10][10];
  int a,b,c;
  int cou=0,max=0;
  int ink[3]={5,9,13};
  int tmp[3][2][13]={
    {{0,0,1,0,-1},{0,-1,0,1,0}},
    {{0,0,1,1,1,0,-1,-1,-1},{0,-1,-1,0,1,1,1,0,-1}},
    {{0,0,1,1,1,0,-1,-1,-1,0,2,0,-2},{0,-1,-1,0,1,1,1,0,-1,-2,0,2,0}}
  };
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      x[i][j] = 0;
    }
  }
  while(scanf("%d,%d,%d\n",&a,&b,&c) != EOF){
    c--;
    for(int i=0;i<ink[c];i++){
      if(a+tmp[c][0][i]>=0 && a+tmp[c][0][i]<10 && b+tmp[c][1][i]>=0 && b+tmp[c][1][i]<10){
	x[a+tmp[c][0][i]][b+tmp[c][1][i]]++;
      }
    }
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(x[i][j] == 0){
	cou++;
      }
      else if(x[i][j] > max){
	max = x[i][j];
      }
    }
  }
  cout << cou << endl << max << endl;
}

C++: #include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }

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 area[10][10];

int main() {
	minit(area, 0);
	
	int x, y, size; char c;
	while (cin>>x>>c>>y>>c>>size) {
		switch (size) {
			case 1:
				for_(i, -1, 2) {
					for_(j, -1, 2) {
						if (x+i<0  || 9<x+i || y+j<0 || 9<y+j) continue;
						area[x+i][y+j] += s[i+1][j+1];
					}
				}
				break;
			case 2:
				for_(i, -1, 2) {
					for_(j, -1, 2) {
						if (x+i<0  || 9<x+i || y+j<0 || 9<y+j) continue;
						area[x+i][y+j] += m[i+1][j+1];
					}
				}
				break;
			case 3:
				for_(i, -2, 3) {
					for_(j, -2, 3) {
						if (x+i<0  || 9<x+i || y+j<0 || 9<y+j) continue;
						area[x+i][y+j] += l[i+2][j+2];
					}
				}
				break;
			default:
				break;
		}
	}
	
	int n0 = 0, m = 0;
	for (int i=0; i<10; i++) {
		for (int j=0; j<10; j++) {
			m = max(m, area[i][j]);
			if (area[i][j]==0) n0++;
		}
	}
	
	cout << n0 << endl << m << endl;
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
int main()
{		int x, y, n;
		char c, b;
	int a = 0;
	int s = 100;
	int xy[10][10] = {};
	while (std::cin >>x>> c >> y >> b >> n) {
		switch (n)
		{
		case 1: {
			if (x != 0) {
				++xy[x - 1][y];
			}
			++xy[x + 1][y];
			if (y != 0) {
				++xy[x][y - 1];
			}
			++xy[x][y + 1];
			break;
		}
		case 2: {
			if (x != 0) {
				++xy[x - 1][y];
				++xy[x - 1][y - 1];
				++xy[x - 1][y + 1];
			}
			if (y != 0) {
				++xy[x][y - 1];
				++xy[x + 1][y - 1];
			}
			++xy[x + 1][y];
			++xy[x][y + 1];
			++xy[x + 1][y + 1];
			break;
		}
		case 3: {
			if (x != 0) {
				++xy[x - 1][y];
				++xy[x - 1][y - 1];
				++xy[x - 1][y + 1];
			}
			if (y != 0) {
				++xy[x][y - 1];
				++xy[x + 1][y - 1];
			}
			++xy[x + 1][y];
			++xy[x][y + 1];
			++xy[x + 1][y + 1];
			if (x != 2) { ++xy[x - 2][y]; }
			++xy[x + 2][y];
			if (y != 2) {
				++xy[x][y - 2];
			}
			++xy[x][y + 2];
			break;
		}
		}
	}

	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 10; ++j) {
			if (xy[i][j] > 0) {
				--s;
			}
		}
	}
	a = xy[0][0];
	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 10; ++j) {
			if (a < xy[i][j]) {
				a = xy[i][j];
			}
		}
	}
	std::cout << s-1 << std::endl;
	std::cout << a << std::endl;
	return 0;
}