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 <stdio.h>

int x, y, q, r1, r2, ok[10][10];

int main()
{
	while (~scanf("%d,%d,%d", &x, &y, &q), x--, y--)
	{
		if (q == 1)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (-1 <= i + j && i + j <= 1)
					{
						if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
						{
							ok[y + i][x + j]++;
						}
					}
				}
			}
		}

		if (q == 2)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
					{
						ok[y + i][x + j]++;
					}
				}
			}
		}

		if (q == 3)
		{
			for (int i = -2; i <= 2; i++)
			{
				for (int j = -2; j <= 2; j++)
				{
					if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
					{
						ok[y + i][x + j]++;
					}
				}
			}
		}
	}

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

			if (ok[i][j] > r2)
			{
				r2 = ok[i][j];
			}
		}
	}

	printf("%d\n", r1);
	printf("%d\n", r2);

	return 0;
}

C++: #include <iostream>
using namespace std;
int paper[10][10]={0};

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

int ink(int y, int x, int size){
	switch(size){
		case 3:
			drop(y-2, x); drop(y+2, x);
			drop(y, x-2); drop(y, x+2);
		case 2:
			drop(y-1, x-1); drop(y-1, x+1);
			drop(y+1, x-1); drop(y+1, x+1);
		case 1:
			drop(y, x);
			drop(y-1, x); drop(y+1, x);
			drop(y, x-1); drop(y, x+1);
	}
	return 0;
}

int main(void){
	
	while (true){
		int x,y,size;
		char c;
		cin>>x>>c>>y>>c>>size;
		if (cin.eof()) break;
		ink(y, x, size);
	}

	int n=10, c1=0, c2=0;
	for (int i=0; i<n; i++){
		for (int j=0; j<n; j++){
			int tmp = paper[j][i];
			if (tmp==0) c1++;
			if (tmp>c2) c2=tmp;
		}
	}
	cout<<c1<<endl;
	cout<<c2<<endl;
	return 0;
}

C++: #include <iostream>
#include <stack>

using namespace std;

void Solution()
{

    int ink[][2] = {{0,0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}, {-2, 0}, {2, 0}, {0, 2}, {0, -2}}; // range from small size to big size
    
    int x;
    int y;
    int size;
    char comma;
    
    int a[10][10] = {{0}}; // the boundary, +1 for judging the spread of ink
    
    int count = 0;
    int density = 0;
    
    while (cin>>x>>comma>>y>>comma>>size)
    {
        for (int i = 0; i <= size * 4; i++)
        {
            if (x + ink[i][0] > 10 && x + ink[i][0] < 0 && y + ink[i][1] > 10 && y + ink[i][1] < 0)
            {
                continue;
            }
            else
            {
                a[x + ink[i][0]][y + ink[i][1]]++;
            }
        
        }
        
    }
    
    for (int i = 0; i < 10; i++)
    {
        for (int j = 0; j < 10; j++)
        {
            if(a[i][j] > 0)
            {
                count++;
            }
            
            if (a[i][j] > density)
            {
                density = a[i][j];
            }
        }
    }

    
    cout<<100 - count<<endl;
    cout<<density<<endl;

}

int main()
{
    Solution();
    return 0;
}

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
constexpr int MOD = 1000000007;
constexpr int INF = 2000000000;
using namespace std;


int main() {
	int map[50][50] = { 0 };
	int a, b, c;
	char ch;
	while (cin >> a >> ch >> b >> ch >> c) {
		map[b][a]++;
		if (c == 1) {
			map[b + 1][a]++;
			map[b - 1][a]++;
			map[b][a + 1]++;
			map[b][a - 1]++;
		}
		else if (c == 2) {
			map[b - 1][a - 1]++;
			map[b - 1][a]++;
			map[b - 1][a + 1]++;
			map[b][a + 1]++;
			map[b + 1][a + 1]++;
			map[b + 1][a]++;
			map[b + 1][a - 1]++;
			map[b][a - 1]++;
		}
		else {
			map[b - 1][a - 1]++;
			map[b - 1][a]++;
			map[b - 1][a + 1]++;
			map[b][a + 1]++;
			map[b + 1][a + 1]++;
			map[b + 1][a]++;
			map[b + 1][a - 1]++;
			map[b][a - 1]++;
			map[b + 2][a]++;
			map[b - 2][a]++;
			map[b][a + 2]++;
			map[b][a - 2]++;
		}
	}
	int ans = 0, maxl = 0;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (!map[i][j])ans++;
			maxl = max(maxl, map[i][j]);
		}
	}
	cout << ans << endl << maxl << endl;
}

C++: #include<iostream>
using namespace std;
int ink[14][14] = {};

int main() {
	int x, y, s;
	char c;
	while (cin >> x >> c >> y >> c >> s) {
		x += 2; y += 2;
		if (s == 1) {
			ink[y - 1][x]++;
			ink[y][x - 1]++;
			ink[y][x]++;
			ink[y][x + 1]++;
			ink[y + 1][x]++;
		}
		else if (s == 2) {
			ink[y - 1][x - 1]++;
			ink[y - 1][x]++;
			ink[y - 1][x + 1]++;
			ink[y][x - 1]++;
			ink[y][x]++;
			ink[y][x + 1]++;
			ink[y + 1][x - 1]++;
			ink[y + 1][x]++;
			ink[y + 1][x + 1]++;
		}
		else if (s == 3) {
			ink[y - 2][x]++;
			ink[y - 1][x - 1]++;
			ink[y - 1][x]++;
			ink[y - 1][x + 1]++;
			ink[y][x - 2]++;
			ink[y][x - 1]++;
			ink[y][x]++;
			ink[y][x + 1]++;
			ink[y][x + 2]++;
			ink[y + 1][x - 1]++;
			ink[y + 1][x]++;
			ink[y + 1][x + 1]++;
			ink[y + 2][x]++;
		}
	}
	int cnt = 0, max = 0;
	for (int i = 2; i < 12; i++) {
		for (int j = 2; j < 12; j++) {
			if (ink[i][j]) cnt++;
			if (ink[i][j] > max) max = ink[i][j];
		}
	}
	cout << 100 - cnt << endl << max << endl;
}