Go: package main

import (
        "fmt"
)

var paper [10][10]int

func main() {
        var x, y, s int
        for {
                _, err := fmt.Scanf("%d,%d,%d", &x, &y, &s)
                if err != nil {
                        break
                }

                fill(x, y, s)
        }
        var d, z int
        for i := 0; i < 10; i++ {
                for j := 0; j < 10; j++ {
                        if paper[i][j] == 0 {
                                z += 1
                        }
                        if paper[i][j] > d {
                                d += 1
                        }
                }
        }
        fmt.Printf("%d\n%d\n", z, d)
}

func fill(x int, y int, s int) {
        paper[x][y] += 1
        if x > 0 {
                paper[x-1][y] += 1
        }
        if x < 9 {
                paper[x+1][y] += 1
        }
        if y > 0 {
                paper[x][y-1] += 1
        }
        if y < 9 {
                paper[x][y+1] += 1
        }

        if s >= 2 {
                if x > 0 && y > 0 {
                        paper[x-1][y-1] += 1
                }
                if x > 0 && y < 9 {
                        paper[x-1][y+1] += 1
                }
                if x < 9 && y > 0 {
                        paper[x+1][y-1] += 1
                }
                if x < 9 && y < 9 {
                        paper[x+1][y+1] += 1
                }
        }

        if s > 2 {
                if x > 1 {
                        paper[x-2][y] += 1
                }
                if x < 8 {
                        paper[x+2][y] += 1
                }
                if y > 1 {
                        paper[x][y-2] += 1
                }
                if y < 8 {
                        paper[x][y+2] += 1
                }
        }
}

C++: //include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))

int main(){
    int x,y,s;
    char c;
    int a[14][14]={0};
    while(cin>>x>>c>>y>>c>>s){
      if(s==1){
         a[x+2][y+2]++;
         a[x+1][y+2]++;
         a[x+2][y+1]++;
         a[x+3][y+2]++;
         a[x+2][y+3]++;
      }
      if(s==1){
         a[x+1][y+1]++;
         a[x+1][y+2]++;
         a[x+1][y+3]++;
         a[x+2][y+1]++;
         a[x+2][y+2]++;
         a[x+2][y+3]++;
         a[x+3][y+1]++;
         a[x+3][y+2]++;
         a[x+3][y+3]++;
      }
      if(s==2){
         a[x+1][y+1]++;
         a[x+1][y+2]++;
         a[x+1][y+3]++;
         a[x+2][y+1]++;
         a[x+2][y+2]++;
         a[x+2][y+3]++;
         a[x+3][y+1]++;
         a[x+3][y+2]++;
         a[x+3][y+3]++;
         a[x][y+2]++;
         a[x+2][y]++;
         a[x+2][y+4]++;
         a[x+4][y+2]++;
      }
    }
    int max=0,sum=0;
    loop(i,2,12)loop(j,2,12){
      if(a[i][j]==0) sum++;
      if(a[i][j]>max) max=a[i][j];
    }
    cout << sum << endl;
    cout << max << endl;
}

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

int main() {
    int x1, y1, size;
    char temp;
    int zeroDensity = 0, maxDensity = 0;
    int paper[10][10];

    for (int i = 0; i != 10; ++i) {
        for (int j = 0; j != 10; ++j) {
            paper[i][j] = 0;
        }
    }

    while (cin >> x1 >> temp >> y1 >> temp >> size) {
        switch (size) {
            case 1:
                paper[x1][y1]++;    // center
                paper[x1][y1-1]++;  // top
                paper[x1+1][y1]++;  // right
                paper[x1][y1+1]++;  // bottom
                paper[x1-1][y1]++;  // left
                break;
            case 2:
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1-1]++; }
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1]++; }
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1+1]++; }
                break;
            case 3:
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1-1]++; }
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1]++; }
                for (int i = -1; i != 2; ++i) { paper[x1 + i][y1+1]++; }
                paper[x1][y1-2]++;  // top
                paper[x1+2][y1]++;  // right
                paper[x1][y1+2]++;  // bottom
                paper[x1-2][y1]++;  // left
                break;
        }
    }

    for (int i = 0; i != 10; ++i) {
        for (int j = 0; j != 10; ++j) {
            if (paper[i][j] == 0) {
                ++zeroDensity;
            }
            if (paper[i][j] > maxDensity) {
                maxDensity = paper[i][j];
            }
        }
    }
    cout << zeroDensity << endl;
    cout << maxDensity << endl;
    return 0;
}

C++: #include<cstdio>
#define MAX(x,y) ((x>y)? x:y)

int paper[14][14];
class ink {
public: 
	int x,y;
	ink(int X,int Y)
	{
		x=X,y=Y;
	}
};
class ink date_1[]={ink(-1,0),ink(0,-1),ink(1,0),ink(0,1),ink(0,0)};
class ink date_2[]={ink(-1,-1),ink(-1,0),ink(-1,1),ink(0,-1),ink(0,0),ink(0,1),ink(1,-1),ink(1,0),ink(1,1)};
class ink date_3[]={ink(-2,0),ink(0,-2),ink(2,0),ink(0,2),ink(-1,-1),ink(-1,0),ink(-1,1),ink(0,-1),ink(0,0),ink(0,1),ink(1,0),ink(1,1)};

void fail(int kind,int x,int y)
{
	if(kind==1)
	{
		for(int i=0;i<5;i++)
		{
			paper[x+date_1[i].x+2][y+date_1[i].y+2]++;
		}
	}
	if(kind==2)
	{
		for(int i=0;i<9;i++)
		{
			paper[x+date_2[i].x+2][y+date_2[i].y+2]++;
		}
	}
	if(kind==3)
	{
		for(int i=0;i<13;i++)
		{
			paper[x+date_3[i].x+2][y+date_3[i].y+2]++;
		}
	}
}

int main()
{
	int x,y,size;
	for(int i=2;i<12;i++)
	{
		for(int j=2;j<12;j++)
		{
			paper[i][j]=0;
		}
	}
	while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
	{
		fail(size,x,y);
	}
	int white=0;
	int maxblack=0;
	for(int i=2;i<12;i++)
	{
		for(int j=2;j<12;j++)
		{
			if(paper[i][j]==0)white++;
			else maxblack=MAX(maxblack,paper[i][j]);
		}
	}
	printf("%d\n%d\n",white,maxblack);
    return 0;
}