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 <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 <stdio.h>
#include<math.h>
using namespace std;

bool rangeCheck(int x,int y){
	if(x >= 0 && x <= 9 && y>=0 && y <= 9)return true;
	else{
		return false;
	}
}

int main(){
	int paper[10][10],x,y,size;
	for(int i=0;i<10;i++){
		for(int k=0;k<10;k++){
			paper[i][k] = 0;
		}
	}

	while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
		switch(size){
		case 1:
			paper[x][y]++;
			if(rangeCheck(x,y-1))paper[x][y-1]++;
			if(rangeCheck(x,y+1))paper[x][y+1]++;
			if(rangeCheck(x-1,y))paper[x-1][y]++;
			if(rangeCheck(x+1,y))paper[x+1][y]++;
			break;
		case 2:
			paper[x][y]++;
			if(rangeCheck(x-1,y-1))paper[x-1][y-1]++;
			if(rangeCheck(x,y-1))paper[x][y-1]++;
			if(rangeCheck(x+1,y-1))paper[x+1][y-1]++;
			if(rangeCheck(x-1,y))paper[x-1][y]++;
			if(rangeCheck(x+1,y))paper[x+1][y]++;
			if(rangeCheck(x-1,y+1))paper[x-1][y+1]++;
			if(rangeCheck(x,y+1))paper[x][y+1]++;
			if(rangeCheck(x+1,y+1))paper[x+1][y+1]++;
			break;
		case 3:
			paper[x][y]++;
			if(rangeCheck(x-1,y-1))paper[x-1][y-1]++;
			if(rangeCheck(x,y-1))paper[x][y-1]++;
			if(rangeCheck(x+1,y-1))paper[x+1][y-1]++;
			if(rangeCheck(x-1,y))paper[x-1][y]++;
			if(rangeCheck(x+1,y))paper[x+1][y]++;
			if(rangeCheck(x-1,y+1))paper[x-1][y+1]++;
			if(rangeCheck(x,y+1))paper[x][y+1]++;
			if(rangeCheck(x+1,y+1))paper[x+1][y+1]++;
			if(rangeCheck(x,y-2))paper[x][y-2]++;
			if(rangeCheck(x-2,y))paper[x-2][y]++;
			if(rangeCheck(x+2,y))paper[x+2][y]++;
			if(rangeCheck(x,y+2))paper[x][y+2]++;
			break;
		}
	}

	int count = 0,max = -1;
	for(int i=0; i< 10;i++){
		for(int k=0; k < 10; k++){
			if(paper[i][k] == 0)count++;
			max = (max >= paper[i][k])?max:paper[i][k];
		}
	}
	printf("%d\n%d\n",count,max);

    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<string>
#include<queue>
#include<algorithm>
#include<utility>
#include<vector>
using namespace std;
vector<vector<int>> pap(10, vector<int>(10, 0));
void big( int, int);
void medium(int, int);
void small(int, int);
int sx[5] = { 0,1,-1,0,0 }, sy[5] = { 0,0,0,1,-1 };
int mx[4] = { 1,1,-1,-1 }, my[4] = { 1,-1,1,-1 };
int bx[4] = { 0,0,2,-2 }, by[4] = { 2,-2,0,0 };
int nana = 100;
int main() {
	string str;
	while (cin >> str) {
		if (str[4] == '1') small(str[0]-'0', str[2] - '0');
		else if (str[4] == '2')medium(str[0]-'0', str[2] - '0');
		else if (str[4] == '3')big(str[0] - '0', str[2] - '0');
	}
	int max = -1;
	for (int i = 0; i < 10; ++i) {
		for (int j = 0; j < 10; ++j) {
			if (max < pap[i][j])max = pap[i][j];
		}
	}
	cout << nana << endl << max << endl;
	return 0;
}
void big( int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]]==0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + mx[i] >= 0 && x + mx[i] < 10 && y + my[i] >= 0 && y + my[i] < 10) {
			if (pap[x + mx[i]][y + my[i]]==0) nana--;
			pap[x + mx[i]][y + my[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + bx[i] >= 0 && x + bx[i] < 10 && y + by[i] >= 0 && y + by[i] < 10) {
			if (pap[x + bx[i]][y + by[i]] == 0) nana--;
			pap[x + bx[i]][y + by[i]]++;
		}
	}
	return;
}
void medium( int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]] == 0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	for (int i = 0; i < 4; ++i) {
		if (x + mx[i] >= 0 && x + mx[i] < 10 && y + my[i] >= 0 && y + my[i] < 10) {
			if (pap[x + mx[i]][y + my[i]] == 0) nana--;
			pap[x + mx[i]][y + my[i]]++;
		}
	}
	return;
}
void small( int x, int y) {
	for (int i = 0; i < 5; ++i) {
		if (x + sx[i] >= 0 && x + sx[i] < 10 && y + sy[i] >= 0 && y + sy[i] < 10) {
			if (pap[x + sx[i]][y + sy[i]] == 0) nana--;
			pap[x + sx[i]][y + sy[i]]++;
		}
	}
	return;
}