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 <cstdio>
#define MAX_N 10
#define MAX_M 10
using namespace std;

int field[MAX_N][MAX_M] = {0};
int x, y, size, nx, ny;

void Big()
{
	int mx[13] = {-1, -1, -1, 0, 0, 0, 1, 1, 1, -2, 0, 0, 2}, my[13] = {-1, 0, 1, -1, 0, 1, -1, 0, 1, 0, -2, 2, 0};
	for (int i = 0; i < 9; i++) {
		nx = x + mx[i]; ny = y + my[i];
		if (0 <= nx && nx < MAX_N && 0 <= ny && ny < MAX_M) field[nx][ny]++; 
	}
}

void Midole()
{
	int mx[9] = {-1, -1, -1, 0, 0, 0, 1, 1, 1}, my[9] = {-1, 0, 1, -1, 0, 1, -1, 0, 1};
	for (int i = 0; i < 9; i++) {
		nx = x + mx[i]; ny = y + my[i];
		if (0 <= nx && nx < MAX_N && 0 <= ny && ny < MAX_M) field[nx][ny]++; 
	}
}

void Mini()
{
	int mx[5] = {-1, 0, 0, 0, 1}, my[5] = {0, -1, 0, 1, 0};
	for (int i = 0; i < 5; i++) {
		nx = x + mx[i]; ny = y + my[i];
		if (0 <= nx && nx < MAX_N && 0 <= ny && ny < MAX_M) field[nx][ny]++; 
	}
}

int main(void)
{
	int ans = 0, color = 0;
	while (scanf("%d,%d,%d", &x, &y, &size) != EOF) {
		switch (size) {
			case 1: Mini(); break;
			case 2: Midole(); break;
			case 3: Big(); break;
		}
	}
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (field[i][j] == 0) ans++;
			else if (color < field[i][j]) color = field[i][j];
		}
	}
	cout << ans << endl << color << endl;

	return 0;
}

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

int main()
{
	int xy[10][10] = {0};
	int x,y,size;
	
	while(scanf("%d,%d,%d", &x,&y,&size) != EOF){
		if(size >= 1){
		xy[y-1][x]++;
		xy[y][x-1]++;
		xy[y][x]++;
		xy[y][x+1]++;
		xy[y+1][x]++;
		}
		if(size >= 2){
			xy[y-1][x-1]++;
			xy[y-1][x+1]++;
			xy[y+1][x-1]++;
			xy[y+1][x+1]++;
		}
		if(size == 3){
			xy[y-2][x]++;
			xy[y][x-2]++;
			xy[y][x+2]++;
			xy[y+2][x]++;
		}
	}
	int w=0,con = 0;
	
	for(int i=0; i < 10; i++){
		for(int j=0; j < 10; j++){
			if(xy[i][j] == 0)w++;
			if(con < xy[i][j])con = xy[i][j];
		}
	}
	
	printf("%d\n%d\n", w, con);

	return (0);
}

C++: #include <iostream>
#include <array>
#include <algorithm>
#include <cstdint>

int main()
{
	std::uint16_t const bias = 2;
	typedef std::array<std::uint16_t, 10 + 2 * bias> Row;
	typedef std::array<Row, 10 + 2 * bias> Paper;
	Paper paper;

	for (Row& row : paper) {
		row.fill(0);
	}

	std::uint16_t x, y, size;
	char comma;
	while (std::cin >> x >> comma >> y >> comma >> size) {
		enum { Small = 1, Medium, Large };
		x += bias;
		y += bias;

		++paper[x][y];
		++paper[x + 1][y];
		++paper[x - 1][y];
		++paper[x][y + 1];
		++paper[x][y - 1];

		if (size != Small) {
			++paper[x + 1][y + 1];
			++paper[x + 1][y - 1];
			++paper[x - 1][y + 1];
			++paper[x - 1][y - 1];

			if (size == Large) {
				++paper[x + 2][y];
				++paper[x - 2][y];
				++paper[x][y + 2];
				++paper[x][y - 2];
			}
		}
	}

	std::uint16_t num_empty = 0;
	std::uint16_t max_density = 0;
	for (std::uint16_t i = bias; i < 10 + bias; ++i) {
		Row const& row = paper[i];
		num_empty += std::count(row.begin() + 2, row.end() - 2, 0);
		max_density = std::max(
				max_density,
				*std::max_element(row.begin() + 2, row.end() - 2));
	}

	std::cout << num_empty << '\n' << max_density << std::endl;

	return 0;
}

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

#pragma warning(disable : 4996)

int x, y, q, r1, r2, ok[10][10];

int main()
{
	while (~scanf("%d,%d,%d", &x, &y, &q), x--, y--)
	{
		if (q == 1)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (abs(i) + abs(j) <= 1)
					{
						if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
						{
							ok[y + i][x + j]++;
						}
					}
				}
			}
		}

		if (q == 2)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
					{
						ok[y + i][x + j]++;
					}
				}
			}
		}

		if (q == 3)
		{
			for (int i = -2; i <= 2; i++)
			{
				for (int j = -2; j <= 2; j++)
				{
					if (abs(i) + abs(j) <= 2)
					{
						if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
						{
							ok[y + i][x + j]++;
						}
					}
				}
			}
		}
	}

	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (ok[i][j] == 0)
			{
				r1++;
			}

			if (ok[i][j] > r2)
			{
				r2 = ok[i][j];
			}
		}
	}

	printf("%d\n", r1);
	printf("%d\n", r2);

	return 0;
}

C++: #include "bits/stdc++.h"
#include<unordered_map>
#pragma warning(disable:4996)
using namespace std;

struct ToUpper {
	char operator()(char c) { return toupper(c); }
};

int num[20][20];

int main() {
	memset(num, 0, sizeof(num));
	string st;
	while (getline(cin, st)) {
		int x = st[0] - '0';
		int y = st[2] - '0';
		x += 5;
		y += 5;
		int size = st[4] - '0';

		for (int i = 0; i < 20; ++i) {
			for (int j = 0; j < 20; ++j) {
				if (size == 0) {
					int lim = 1;
					int sa = abs(i - y) + abs(j - x);
					if (sa < size)num[i][j]++;
				}
				else if (size == 3) {
					int lim = 2;
					int sa = abs(i - y) + abs(j - x);
					if (sa < size)num[i][j]++;
				}
				else {
					if (abs(i - y) <= 1 && abs(j - x) <= 1)num[i][j]++;
				}
				
			}
		}
	}
	int a = 0;
	int b = 0;
	for (int i = 5; i < 15; ++i) {
		for (int j = 5; j < 15; ++j) {
			if (!num[i][j])a++;
			b = max(b, num[i][j]);
		}
	}
	cout << a <<endl<< b << endl;
	return 0;
}