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<stdio.h>
#include<math.h>
#include<string>
#include<queue>
#include<algorithm>
#include<utility>
#include<vector>
#include<list>
using namespace std;
void big(vector<vector<int>>&, int, int);
void medium(vector<vector<int>>&, int, int);
void small(vector<vector<int>>&, int, int);
int sx[5] = { 0,1,-1,0,0 }, sy[5] = { 0,0,0,1,-1 };
int mx[4] = { 1,1,-1,-1 }, my[4] = { 1,-1,1,-1 };
int bx[4] = { 0,0,2,-2 }, by[4] = { 2,-2,0,0 };
int nana = 100;
int main() {
	
	string str;
	vector<vector<int>> pap(10, vector<int>(10, 0));
	while (cin >> str) {
		if (str[4] == '1') small(pap, str[0]-'0', str[2] - '0');
		else if (str[4] == '2')medium(pap, str[0]-'0', str[2] - '0');
		else if (str[4] == '3')big(pap, str[0] - '0', str[2] - '0');
	}
	int max = -1;
	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 10; ++j) {
			if (max < pap[i][j])max = pap[i][j];
		}
	}
	cout << nana << endl << max << endl;
	return 0;
}
void big(vector<vector<int>>&pap, int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]]==0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + mx[i] >= 0 && x + mx[i] < 10 && y + my[i] >= 0 && y + my[i] < 10) {
			if (pap[x + mx[i]][y + my[i]]==0) nana--;
			pap[x + mx[i]][y + my[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + bx[i] >= 0 && x + bx[i] < 10 && y + by[i] >= 0 && y + by[i] < 10) {
			if (pap[x + bx[i]][y + by[i]] == 0) nana--;
			pap[x + bx[i]][y + by[i]]++;
		}
	}
	return;
}
void medium(vector<vector<int>>&pap, int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]] == 0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + mx[i] >= 0 && x + mx[i] < 10 && y + my[i] >= 0 && y + my[i] < 10) {
			if (pap[x + mx[i]][y + my[i]] == 0) nana--;
			pap[x + mx[i]][y + my[i]]++;
		}
	}
	return;
}
void small(vector<vector<int>>&pap, int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]] == 0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	return;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int paper[10][10];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int dx2[] = {1, 1, 1, 0, -1, -1, -1, 0};
int dy2[] = {1, 0, -1, -1, -1, 0, 1, 1};
void make_spot(int x, int y, int s){
	paper[x][y]++;
	int nx, ny;
	if(s == 1){
		for(int i = 0; i < 4; i++){
			nx = x + dx[i], ny = y + dy[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}else if(s == 2){
		for(int i = 0; i < 8; i++){
			nx = x + dx2[i], ny = y + dy2[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}else if(s == 3){
		for(int i = 0; i < 8; i++){
			nx = x + dx2[i], ny = y + dy2[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
		for(int i = 0; i < 4; i++){
			nx = x + 2 * dx[i], ny = y + 2 * dy[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}
	return ;
}
int main(){
	fill(paper[0], paper[10], 0);
	for(;;){
		int x, y, s;
		if(scanf("%d,%d,%d", &x, &y, &s) == EOF) break;
		make_spot(x, y, s);
	}
	int cnt = 0, max_density = 0;
	for(int i = 0; i < 10; i++){
		for(int j = 0; j < 10; j++){
			if(paper[i][j] == 0) cnt++;
			if(paper[i][j] > max_density) max_density = paper[i][j];
		}
	}
	cout << cnt << endl << max_density << endl;
	return 0;
}

C++: #include<stdio.h>
#define MAX 10
#define rep(i, n) for ( int i = 0; i < n; i++)
main(){
    int P[MAX+4][MAX+4];
    int dx[13] = {0, 1, 0, -1, 0, 1, -1, -1, 1, 2, 0, -2, 0};
    int dy[13] = {0, 0, -1, 0, 1, -1, -1, 1, 1, 0, -2, 0, 2};
    int x, y, size, empty = 0, maxv = 0;
    rep(y,MAX+4) rep(x,MAX+4) P[y][x] = 0;
    while ( scanf("%d,%d,%d", &x, &y, &size) != EOF ) {
	x += 2; y += 2;
	rep(r,size*4+1) P[y + dy[r]][x + dx[r]]++;
    }
    for ( int y = 2; y <= 11; y++ ){
        for ( int x = 2; x <= 11; x++ ){
            if ( P[y][x] == 0 ) empty++;
            if ( P[y][x] > maxv ) maxv = P[y][x];
        }
    }
    printf("%d\n%d\n", empty, maxv);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(ll i=(a);i<ll(b);i++)
#define rep(i,b) loop(i,0,b)

int main(){
    int X,Y,t;
    int g[20][20];
    rep(i,20)rep(j,20) g[i][j] = 0;
    while(~scanf("%d,%d,%d\n",&X,&Y,&t)){
        rep(y,10)rep(x,10){
            if(t==1 && abs(x-X)+abs(y-Y) <= 1) ++g[y][x];
            if(t==2 && max(abs(x-X),abs(y-Y)) <= 1) ++g[y][x];
            if(t==3 && abs(x-X)+abs(y-Y) <= 2) ++g[y][x];
        }
    }
    map<int,int> m;
    rep(i,10)rep(j,10) m[g[i][j]]++;
    printf("%d\n%d\n", m.begin()->second, m.rbegin()->first);
}