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<string>
#include<cstdio>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<cmath>
#include<utility>
#define ll long long int
#define ld long double
#define INF 1000000000
#define EPS 0.0000000001
#define rep(i,n) for(i=0;i<n;i++)
using namespace std;
typedef pair<int, int> P;

string str;

int main()
{
  int x,y,size;
  int paper[15][15]={};
  while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){

    x+=2;
    y+=2;

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

    if(size>1){

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

      if(size==3){

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

      }
    }
  }
  int white=0;
  int m=0;
  int i,j;

  for(i=2;i<12;i++)
    for(j=2;j<12;j++){
    if(paper[i][j]==0)white++;
    m=max(m,paper[i][j]);
  }
  cout<<white<<endl;
  cout<<m<<endl;
}

C++: #include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <cctype>
#include <iostream>
#include <set>
#include <string>
#include <queue>
#include <map>
using namespace std;
int size(string x){
	string::size_type size=x.size();
	return size;
}
#define fu(l,k) for(int i=l;i<k;i++)
#define fd(l,k) for(int i=l;i>k;i--)
#define fi first
#define se second
typedef  vector<string> vs;
typedef  vector<int> vi;
double pi(){
	return M_PI;
}
typedef set<int> set_i;
typedef set<string> set_s;
int INF=1000000;
int main(){
	int dp[11][11]={};
	int x,y,ss;
	string s;
	while(cin>>x>>s>>y>>s>>ss){
		dp[x][y]++;
		if(ss==1){
			if(y-1>=0) dp[x][y-1]++;
			if(y+1<=9) dp[x][y+1]++;
			if(x-1>=0) dp[x-1][y]++;
			if(x+1<=9) dp[x+1][y]++;
		}
		if(ss==2){
			if(y-1>=0) dp[x][y-1]++;
			if(y+1<=9) dp[x][y+1]++;
			if(x-1>=0) dp[x-1][y]++;
			if(x+1<=9) dp[x+1][y]++;
			if(x-1>=0&&y-1>=0) dp[x-1][y-1]++;
			if(x+1<=9&&y-1>=0) dp[x+1][y-1]++;
			if(x-1>=0&&y+1<=9) dp[x-1][y+1]++;
			if(x+1<=9&&y+1<=9) dp[x+1][y+1]++;
		}
		if(ss==3){
			if(y-1>=0) dp[x][y-1]++;
			if(y+1<=9) dp[x][y+1]++;
			if(x-1>=0) dp[x-1][y]++;
			if(x+1<=9) dp[x+1][y]++;
			if(x-1>=0&&y-1>=0) dp[x-1][y-1]++;
			if(x+1<=9&&y-1>=0) dp[x+1][y-1]++;
			if(x-1>=0&&y+1<=9) dp[x-1][y+1]++;
			if(x+1<=9&&y+1<=9) dp[x+1][y+1]++;
			if(x+2<=9) dp[x+2][y]++;
			if(x-2>=0) dp[x-2][y]++;
			if(y+2<=9) dp[x][y+2]++;
			if(y-2>=0) dp[x][y-2]++;
		}
	}
	int ans=0,max=0;
	for(int a=0;a<10;a++){
		for(int b=0;b<10;b++){
			if(dp[a][b]==0) ans++;
			if(dp[a][b]>=max) max=dp[a][b];
		}
	}
	cout<<ans<<endl;
	cout<<max<<endl;
}

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

typedef pair<int, int> p;
p ink1[4] = { p(0, 1), p(0, -1), p(1, 0), p(-1, 0) };
p ink2[4] = { p(1, 1), p(-1, -1), p(1, -1), p(-1, 1) };
p ink3[4] = { p(0, 2), p(0, -2), p(2, 0), p(-2, 0) };

int table[10][10];

int main()
{
	int x, y, size;
	while (scanf("%d,%d,%d", &x, &y, &size) != -1)
	{
		table[x][y]++;
		for (int i = 0; i < 4; i++)
		{
			int X = x + ink1[i].first;
			int Y = y + ink1[i].second;
			if (0 <= X && X <= 9 && 0 <= Y && Y <= 9) table[X][Y]++;
		}

		if (size == 1) continue;
		for (int i = 0; i < 4; i++)
		{
			int X = x + ink2[i].first;
			int Y = y + ink2[i].second;
			if (0 <= X && X <= 9 && 0 <= Y && Y <= 9) table[X][Y]++;
		}

		if (size == 2) continue;
		for (int i = 0; i < 4; i++)
		{
			int X = x + ink3[i].first;
			int Y = y + ink3[i].second;
			if (0 <= X && X <= 9 && 0 <= Y && Y <= 9) table[X][Y]++;
		}
	}

	int n = 0;
	int Max = 0;
	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (table[i][j] == 0) n++;
			Max = max(Max, table[i][j]);
		}
	}
	printf("%d\n%d\n", n, Max);

	return 0;
}