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>
using namespace std;

int paper[10][10];

void drop(int x, int y) {
    if (x >= 0 && x < 10 && y >= 0 && y < 10) {
        paper[x][y]++;
    }
}

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

    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:
                drop(x1, y1);    // center
                drop(x1, y1-1);  // top
                drop(x1+1,y1);  // right
                drop(x1,y1+1);  // bottom
                drop(x1-1,y1);  // left
                break;
            case 2:
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1-1); }
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1); }
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1+1); }
                break;
            case 3:
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1-1); }
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1); }
                for (int i = -1; i != 2; ++i) { drop(x1 + i, y1+1); }
                drop(x1, y1-2);  // top
                drop(x1+2, y1);  // right
                drop(x1, y1+2);  // bottom
                drop(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 <iostream>
#include <algorithm>
#include <map>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>

using namespace std;

int field[10][10];
int x,y,size;


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

    char tmp;
    while(cin>>x>>tmp>>y>>tmp>>size) {
        if(size==1) {
            for(int dx=-1; dx<=1; dx++) {
                int nx = x + dx;
                if(0 <= nx && nx < 10)
                    field[y][nx]++;
            }
            for(int dy=-1; dy<=1; dy++) {
                int ny = y + dy;
                if(0 <= ny && ny < 10)
                    field[ny][x]++;
            }
            field[y][x]--;
        } else if(size == 2) {
            for(int dy=-1; dy<=1; dy++) {
                for(int dx=-1; dx<=1; dx++) {
                    int nx = x + dx, ny = y+dy;
                    if(0 <= nx && nx < 10)
                        if(0 <= ny && ny < 10)
                            field[ny][nx]++;
                }
            }
        } else if(size == 3) {
            for(int dy=-1; dy<=1; dy++) {
                for(int dx=-1; dx<=1; dx++) {
                    int nx = x + dx, ny = y+dy;
                    if(0 <= nx && nx < 10)
                        if(0 <= ny && ny < 10)
                            field[ny][nx]++;
                }
            }
            //field[y][x]--;
            for(int dx=-2; dx<=2; dx+=2) {
                int nx = x + dx;
                if(0 <= nx && nx < 10)
                    field[y][nx]++;
            }
            for(int dy=-2; dy<=2; dy+=2) {
                int ny = y + dy;
                if(0 <= ny && ny < 10)
                    field[ny][x]++;
            }
            field[y][x]--;

        }
    }

    int cnt=0, max=0;
    for(int i=0; i<10; i++) {
        for(int j=0; j<10; j++) {
            if(field[i][j] == 0) cnt++;
            if(max < field[i][j]) max = field[i][j];
        }
    }

    printf("%d\n%d\n", cnt, max);

    return 0;
}

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

int a[15][15];
int dx[] = { 0,0,1,-1 }, dy[] = { 1,-1,0,0 };
int nx[] = { 0,0,2,-2 }, ny[] = { 2,-2,0,0 };
int main() {
	string S;
	while (cin >> S) {
		int x, y, s;
		sscanf(S.data(), "%d,%d,%d", &x, &y, &s);
		if (s == 1) {
			a[x][y]++;
			rep(i, 4) {
				if (x + dx[i] >= 0 && y + dy[i] >= 0)
					a[x + dx[i]][y + dy[i]]++;
			}
		}
		else for (int i = -1; i <= 1; i++)for (int j = -1; j <= 1; j++) {
			if (x + i >= 0 && x + j >= 0)a[x + i][y + j]++;
		}
		if (s == 3)rep(i, 4) {
			if (x + nx[i] >= 0 && y + ny[i] >= 0)
				a[x + nx[i]][y + ny[i]]++;
		}
	}
	int cnt = 0, Max = 0;
	rep(i, 10) {
		rep(j, 10) {
			if (!a[i][j])cnt++;
			Max = max(Max, a[i][j]);
		}
	}
	cout << cnt << endl << Max << endl;
	return 0;
}

C++: #include <stdio.h>
#include <stdlib.h>
int main(void)
{
    int i,j,x,y,size,paper[10][10]={0},ans1=0,ans2=0;
    while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
    {
        if(x>=0&&x<10&&y>=0&&y<10)
        {
            paper[x][y]++;
            if(x!=0)
                paper[x-1][y]++;
            if(x!=9)
                paper[x+1][y]++;
            if(y!=0)
                paper[x][y-1]++;
            if(y!=9)
                paper[x][y+1]++;
            if(size>1)
            {
            if(x!=0&&y!=0)
                paper[x-1][y-1]++;
            if(x!=0&&y!=9)
                paper[x-1][y+1]++;
            if(x!=9&&y!=0)
                paper[x+1][y-1]++;
            if(x!=9&&y!=9)
                paper[x+1][y+1]++;
            }
            if(size>2)
            {
            if(x!=0&&x!=1)
                paper[x-2][y]++;
            if(x!=9&&x!=8)
                paper[x+2][y]++;
            if(y!=0&&y!=1)
                paper[x][y-2]++;
            if(y!=9&&y!=8)
                paper[x][y+2]++;
            }
        }
    }
    for(i=0;i<10;i++)
        for(j=0;j<10;j++)
        {
            if(paper[j][i]==0)
                ans1++;
            if(paper[j][i]>ans2)
                ans2=paper[j][i];
        }
    /*
    for(i=0;i<10;i++){
        for(j=0;j<10;j++)
            printf("%d ",paper[j][i]);
        printf("\n");
    }
    */

    printf("%d\n%d\n",ans1,ans2);
    return 0;
}