Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	paper := make([][]int, 10)
	for i := range paper {
		paper[i] = make([]int, 10)
		for j := range paper[i] {
			paper[i][j] = 0
		}
	}
	// fmt.Println(paper)
	for scanner.Scan() {
		infos := strings.Split(scanner.Text(), ",")
		x, _ := strconv.Atoi(infos[0])
		y, _ := strconv.Atoi(infos[1])
		s, _ := strconv.Atoi(infos[2])
		// fmt.Println(x, y, s)
		switch s {
		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]++
			}
			continue
		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]++
			}
			continue
		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]++
			}
			continue
		}
	}
	count := 0
	max := -1
	for i := range paper {
		for j := range paper[i] {
			if paper[i][j] == 0 {
				count++
			}
			if max >= paper[i][j] {
				max = max
			} else {
				max = paper[i][j]
			}
		}
	}
	fmt.Printf("%d\n%d\n", count, max)
}

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;
}