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 <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <valarray>
#include <vector>

#define EPS 1e-9
#define INF 1070000000LL
#define MOD 1000000007LL
#define fir first
#define foreach(it,X) for(__typeof((X).begin()) it=(X).begin();it!=(X).end();it++)
#define ite iterator
#define mp make_pair
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define pb push_back
#define sec second
#define sz(x) ((int)x.size())

using namespace std;

struct timer{
	time_t start;
	timer(){start=clock();}
	~timer(){cerr<<1.*(clock()-start)/CLOCKS_PER_SEC<<" secs"<<endl;}
};

typedef istringstream iss;
typedef long long ll;
typedef pair<int,int> pi;
typedef stringstream sst;
typedef vector<int> vi;

int a[15][15];

int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	
	int y,x,t;
	char c;
	while(cin>>x>>c>>y>>c>>t){
		rep(i,10)rep(j,10){
			if(t==1 || t==3){
				if(abs(i-y)+abs(j-x)<=(t+1)/2){
					a[i][j]++;
				}
			}else{
				if(max(abs(i-y),abs(j-x))<=1){
					a[i][j]++;
				}
			}
		}
	}
	int ans1=0,ans2=0;
	rep(i,10)rep(j,10){
		if(a[i][j]==0)ans1++;
		ans2=max(ans2,a[i][j]);
	}
	cout<<ans1<<endl<<ans2<<endl;
}

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

int main()
{
    int x,y,size,count=0,max=0;
    int dots[10][10]={{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}};
    while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
        dots[y][x]++;
        switch(size){
            case 1 :
                dots[y-1][x]++;
                dots[y][x+1]++;
                dots[y+1][x]++;
                dots[y][x-1]++;
                break;
            case 2 :
                dots[y-1][x]++;
                dots[y-1][x+1]++;
                dots[y][x+1]++;
                dots[y+1][x+1]++;
                dots[y+1][x]++;
                dots[y+1][x-1]++;
                dots[y][x-1]++;
                dots[y-1][x-1]++;
                break;
            case 3 :
                dots[y-1][x]++;
                dots[y-1][x+1]++;
                dots[y][x+1]++;
                dots[y+1][x+1]++;
                dots[y+1][x]++;
                dots[y+1][x-1]++;
                dots[y][x-1]++;
                dots[y-1][x-1]++;
                dots[y-2][x]++;
                dots[y][x+2]++;
                dots[y+2][x]++;
                dots[y][x-2]++;
                break;
        }
    }
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(dots[i][j]==0){
                count++;
            }
            if(max<dots[i][j]){
                max=dots[i][j];
            }
        }
    }
    cout<<count<<endl<<max<<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  string str;
  int paper[10][10];
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      paper[i][j]=0;
    }
  }
  int I=50;
  while(cin >> str){
    int x,y,s;
    x=str[0]-48;
    y=str[2]-48;
    s=str[4]-48;
    if(s==1){
      paper[x][y]++;
      paper[x+1][y]++;
      paper[x-1][y]++;
      paper[x][y+1]++;
      paper[x][y-1]++;
    }
    else if(s==2){
      paper[x][y]++;
      paper[x][y+1]++;
      paper[x][y-1]++;
      paper[x+1][y]++;
      paper[x+1][y+1]++;
      paper[x+1][y-1]++;
      paper[x-1][y]++;
      paper[x-1][y+1]++;
      paper[x-1][y-1]++;
    }
    else if(s==3){
      paper[x][y-2]++;
      paper[x+1][y-1]++;
      paper[x][y-1]++;
      paper[x-1][y-1]++;
      paper[x-2][y]++;
      paper[x-1][y]++;
      paper[x][y]++;
      paper[x+1][y]++;
      paper[x+2][y]++;
      paper[x-1][y+1]++;
      paper[x][y+1]++;
      paper[x+1][y+1]++;
      paper[x][y+2]++;
    }
    int white=0,koii=0;
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        if(paper[i][j]==0)white++;
        koii=max(koii,paper[i][j]);
      }
    }
    cout << white << endl << koii << endl;
  }
}

C++: #include <iostream>

int main()
{
    int density[10][10] = {};
    int x, y, size;
    char comma;
    while (std::cin >> x >> comma >> y >> comma >> size) {
        switch (size) {
        case 3:
            if (x - 2 >= 0) ++density[x - 2][y];
            if (y - 2 >= 0) ++density[x][y - 2];
            if (x + 2 < 10) ++density[x + 2][y];
            if (y + 2 < 10) ++density[x][y + 2];
            // fall through
        case 2:
            if (x - 1 >= 0 && y - 1 >= 0) ++density[x - 1][y - 1];
            if (x - 1 >= 0 && y + 1 < 10) ++density[x - 1][y + 1];
            if (x + 1 < 10 && y - 1 >= 0) ++density[x + 1][y - 1];
            if (x + 1 < 10 && y + 1 < 10) ++density[x + 1][y + 1];
            // fall through
        case 1:
            if (x - 1 >= 0) ++density[x - 1][y];
            if (y - 1 >= 0) ++density[x][y - 1];
            if (x + 1 < 10) ++density[x + 1][y];
            if (y + 1 < 10) ++density[x][y + 1];
        }
        ++density[x][y];
    }

    int cnt = 0, max = 0;
    for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
            if (density[i][j] == 0) ++cnt;
            if (max < density[i][j]) max = density[i][j];
        }
    }
    std::cout << cnt << std::endl << max << std::endl;
}