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

int main() {
	minit(area, 0);
	
	int x, y, s; char c;
	while (cin>>x>>c>>y>>c>>s) {
		area[x][y]++;
		switch (s) {
			case 1:
				if (x-1 >= 0) area[x-1][y]++;
				if (x+1 < 10) area[x+1][y]++;
				if (y-1 >= 0) area[x][y-1]++;
				if (y+1 < 10) area[x][y+1]++;
				break;
			case 2:
				if (x-1 >= 0) {
					area[x-1][y]++;
					if (y-1 >= 0) area[x-1][y-1]++;
					if (y+1 >= 0) area[x-1][y+1]++;
				}
				if (x+1 < 10) {
					area[x+1][y]++;
					if (y-1 >= 0) area[x+1][y-1]++;
					if (y+1 < 10) area[x+1][y+1]++;
				}
				if (y-1 >= 0) area[x][y-1]++;
				if (y+1 < 10) area[x][y+1]++;
				break;
			case 3:
				if (x-1 >= 0) {
					area[x-1][y]++;
					if (y-1 >= 0) area[x-1][y-1]++;
					if (y+1 >= 0) area[x-1][y+1]++;
				}
				if (x+1 < 10) {
					area[x+1][y]++;
					if (y-1 >= 0) area[x+1][y-1]++;
					if (y+1 < 10) area[x+1][y+1]++;
				}
				if (y-1 >= 0) area[x][y-1]++;
				if (y+1 < 10) area[x][y+1]++;
				if (x-2 >= 0) area[x-2][y]++;
				if (x+2 < 10) area[x+2][y]++;
				if (y-2 >= 0) area[x][y-2]++;
				if (y+2 < 10) area[x][y+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 <vector>
#include <sstream>
//#include <fstream>

using namespace std;

int main()
{
//	cut here before submit 
//	freopen("testcase.di", "r", stdin);
	const int small[][3] = { 
					{ 0, 1 ,0 },
					{ 1, 1, 1 },
					{ 0, 1, 0 } 
				};
	const int medium[][3] = {
					{ 1, 1, 1 },
					{ 1, 1, 1 },
					{ 1, 1, 1 }
				};
	const int large[][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 }
				};
										
	string str = "";
	vector <vector <int> > paper (14, vector <int> (14, 0 ) );
	vector <int> px, py, size;

	while (getline (cin, str ) ){
		int x, y, s;
		while (str.find(',') != string::npos ){
			str = str.replace (str.find(','), 1, " " );
		} // end while
		stringstream ss (str );
		ss >> x >> y >> s;
		px.push_back(x); py.push_back(y); size.push_back(s);		
	} // end for
	
	int n = px.size();
	int i,j,k;

	for (k = 0; k < n; ++k ){
		if (size[k] == 1 ){
			for (i = -1; i <= 1; ++i ){
				for (j = -1; j <= 1; ++j ){
					paper[ py[k] + 2 + i][ px[k] + 2 + j] += small[i+1][j+1];
				} // end for
			} // end for
		}else if (size[k] == 2 ){
			for (i = -1; i <= 1; ++i ){
				for (j = -1; j <= 1; ++j ){
					paper[ py[k] + 2 + i][ px[k] + 2 + j] += medium[i+1][j+1];
				} // end for
			} // end for
		}else if (size[k] == 3 ){
			for (i = -2; i <= 2; ++i ){
				for (j = -2; j <= 2; ++j ){
					paper[ py[k] + 2 + i][ px[k] + 2 + j] += large[i+2][j+2];
				} // end for
			} // end for
		} // end if
	} // end for

	int res = 0;
	int maxd = 0;
	for (i = 2; i < 12; ++i ){
		for (j = 2; j < 12; ++j ){
			if (paper[i][j] == 0){
				++res;
			}else{
				maxd = max (maxd, paper[i][j]);
			} // end if
		} // end for
	} // end for

	cout << res << endl;
	cout << maxd << endl;
		
	return 0;
}

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

int m[10][10];
int ax[12]={0,1,0,-1,1,1,-1,-1,0,2,0,-2};
int ay[12]={-1,0,1,0,-1,1,1,-1,-2,0,2,0};

void dfs(int x,int y,int size){
  m[x][y]+=1;
  if(size==1){
    for(int i=0;i<4;i++){
      if(x-ax[i]<0 || x-ax[i]>9 || y-ay[i]<0 || y-ay[i]>9) continue;
      m[x-ax[i]][y-ay[i]]+=1;
    }
  }else if(size==2){
    for(int i=0;i<8;i++){
      if(x-ax[i]<0 || x-ax[i]>9 || y-ay[i]<0 || y-ay[i]>9) continue;
      m[x-ax[i]][y-ay[i]]+=1;
    }
  }else if(size==3){
    for(int i=0;i<12;i++){
      if(x-ax[i]<0 || x-ax[i]>9 || y-ay[i]<0 || y-ay[i]>9) continue;
      m[x-ax[i]][y-ay[i]]+=1;
    }
  }

}


int main(){
  int x,y,size,clear=0,color=0;

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

  while(scanf("%d,%d,%d",&x,&y,&size) != EOF){
    dfs(x,y,size);
  }

  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(m[i][j]==0){
	clear++;
      }else if(m[i][j]>color){
	color=m[i][j];
      }

    }
  }

  cout << clear << endl;
  cout << color << endl;

}