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", count, max)
}

C++: #include<stdio.h>

int main()
{
	int x,y,size;
	int a[14][14]={0};
	while(scanf("%d,%d,%d",&x,&y,&size)!=EOF)
	{
		if(x>=10||x<0||y>=10||y<0||size>3||size<=0)
		{
		}
		else
		{
			x+=2;
			y+=2;
			if(size==1)
			{
				a[x][y]++;
				a[x][y+1]++;
				a[x][y-1]++;
				a[x+1][y]++;
				a[x-1][y]++;
			}
			else if(size==2)
			{
				int n,m;
				n=x-1;
				for(n;n<=x+1;n++)
				{
					m=y-1;
					for(m;m<=y+1;m++)
					{
						a[n][m]++;
					}
				}
			}
			else if(size==3)
			{
				int n,m;

				a[x][y+2]++;
				a[x][y-2]++;
				a[x+2][y]++;
				a[x-2][y]++;

				n=x-1;
				for(n;n<=x+1;n++)
				{
					m=y-1;
					for(m;m<=y+1;m++)
					{
						a[n][m]++;
					}
				}
			}
		}
	}

	int zero=0,max=0;
	for(x=2;x<12;x++)
	{
		for(y=2;y<12;y++)
		{
			if(a[x][y]==0)
			{
				zero++;
			}
			if(a[x][y]>max)
			{
				max=a[x][y];
			}
		}
	}
	printf("%d\n%d\n",zero,max);
	return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
	int masu[10][10] = {0};
	int x, y, s, i, j, n = 0, cut = 0;
	int num[100] = {0};

	while(scanf("%d,%d,%d", &x, &y, &s) != EOF){
		masu[x][y] ++;
		if(s == 1){
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
		}
		else if(s == 2){
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
			masu[x-1][y-1] += 1, masu[x+1][y-1] += 1, masu[x-1][y+1] += 1, masu[x-1][y+1] += 1;
		}
		else{
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
			masu[x-1][y-1] += 1, masu[x+1][y-1] += 1, masu[x-1][y+1] += 1, masu[x-1][y+1] += 1;
			masu[x-2][y] += 1, masu[x+2][y] += 1, masu[x][y+2] += 1, masu[x][y-2] += 1;
		}
		
	}

	for(i = 0; i < 10; i ++){
		for(j = 0; j < 10; j ++){
			num[n] = masu[i][j];
			n ++;
		}
	}

	sort(num, num+100);

	for(i =0; i < 100; i ++){
		if(num[i] == 0) cut ++;
		else break;
	}

	cout << cut - 1 << endl << num[99] << endl;

	return 0;    
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(void){
    std::vector<std::vector<int>> vec(10,vector<int>(10,0));
    int x,y,s;
    char c;
    while (cin>>x>>c>>y>>c>>s) {
        if (s==1) {
            vec.at(y).at(x)++;
            if (y-1>=0) { //上
                vec.at(y-1).at(x)++;
            }
            if (x-1>=0) { //左
                vec.at(y).at(x-1)++;
            }
            if (x+1<=9) { //右
                vec.at(y).at(x+1)++;
            }
            if (y+1<=9) { //下
                vec.at(y+1).at(x)++;
            }
        } else if (s==2) {
            vec.at(y).at(x)++;
            if (y-1>=0&&x-1>=0) { //左上
                vec.at(y-1).at(x-1)++;
            }
            if (y-1>=0) { //上
                vec.at(y-1).at(x)++;
            }
            if (y-1>=0&&x+1<=9) { //右上
                vec.at(y-1).at(x+1)++;
            }
            if (x-1>=0) { //左
                vec.at(y).at(x-1)++;
            }
            if (x+1<=9) { //右
                vec.at(y).at(x+1)++;
            }
            if (x-1>=0&&y+1<=9) { //左下
                vec.at(y+1).at(x-1)++;
            }
            if (y+1<=9) { //下
                vec.at(y+1).at(x)++;
            }
            if (x+1<=9&&y+1<=9) { //右下
                vec.at(y+1).at(x+1)++;
            }
        } else if (s==3) {
            vec.at(y).at(x)++;
            if (y-1>=0&&x-1>=0) { //左上
                vec.at(y-1).at(x-1)++;
            }
            if (y-1>=0) { //上
                vec.at(y-1).at(x)++;
            }
            if (y-1>=0&&x+1<=9) { //右上
                vec.at(y-1).at(x+1)++;
            }
            if (x-1>=0) { //左
                vec.at(y).at(x-1)++;
            }
            if (x+1<=9) { //右
                vec.at(y).at(x+1)++;
            }
            if (x-1>=0&&y+1<=9) { //左下
                vec.at(y+1).at(x-1)++;
            }
            if (y+1<=9) { //下
                vec.at(y+1).at(x)++;
            }
            if (x+1<=9&&y+1<=9) { //右下
                vec.at(y+1).at(x+1)++;
            }
            if (y-2>=0) { //最上
                vec.at(y-2).at(x)++;
            }
            if (x+2<=9) { //最右
                vec.at(y).at(x+2)++;
            }
            if (x-2>=0) { //最左
                vec.at(y).at(x-2)++;
            }
            if (y+2<=9) { //最下
                vec.at(y+2).at(x)++;
            }
        }
    }
    int count=0;
    int max=0;
    for (int i=0;i<10;i++) {
        for (int j=0;j<10;j++) {
            if (vec.at(i).at(j)==0) {
                count++;
            }
            if (vec.at(i).at(j)>max) {
                max=vec.at(i).at(j);
            }
        }
    }
    cout<<count<<endl;
    cout<<max<<endl;
}

C++: #include<cstdio>

int main(){
	int p[14][14];
	int x, y, s, max = 0, sum = 100;
	for(int i = 0; i < 14; i++){
		for(int j = 0; j < 14; j++){
			p[i][j] = 0;
		}
	}

	while(scanf("%d,%d,%d", &x, &y, &s) + 1){
		if(s == 0){
			break;
		}
		p[x+2][y+2]++;
		p[x+1][y+2]++;
		p[x+2][y+1]++;
		p[x+3][y+2]++;
		p[x+2][y+3]++;
		s--;
		if(s){
			p[x+1][y+1]++;
			p[x+1][y+3]++;
			p[x+3][y+1]++;
			p[x+3][y+3]++;
			s--;
			if(s){
				p[x][y+2]++;
				p[x+2][y]++;
				p[x+2][y+4]++;
				p[x+4][y+2]++;
			}
		}
	}

	for(int i = 2; i < 12; i++){
		for(int j = 2; j < 12; j++){
			if(p[i][j]){
				sum--;
				if(max < p[i][j]){
					max = p[i][j];
				}
			}
		}
	}

	printf("%d\n%d\n", sum, max);
	return 0;
}