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<bits/stdc++.h>
using namespace std;
signed main(void){
	char c;
	int a[25][25];
	memset(a,0,sizeof(a));
	int x,y,m;
	while(cin>>x>>c>>y>>c>>m){
		x+=5;
		y+=5;
		a[x][y]++;
		a[x-1][y]++;
		a[x+1][y]++;
		a[x][y-1]++;
		a[x][y+1]++;
		if(m==1)
			continue;
		a[x-1][y-1]++;
		a[x-1][y+1]++;
		a[x+1][y-1]++;
		a[x+1][y+1]++;
		if(m==2)
			continue;
		a[x-2][y]++;
		a[x+2][y]++;
		a[x][y-2]++;
		a[x][y+2]++;
	}
	int ans1=0,ans2=0;
	for(int i=5;i<15;i++)
		for(int j=5;j<15;j++){
			if(a[i][j]==0)
				ans1++;
			else if(a[i][j]>ans2)
				ans2=a[i][j];
		}
	cout<<ans1<<endl
		<<ans2<<endl;
}

C++: #include <cstdio>

int m[10][10] = { 0 };

bool inRange(int va) {
    return (0 <= va) && (va < 10);
}

void put(int x, int y, int s) {
    switch (s) {
    case 1:
        m[x][y]++;
        if (inRange(x - 1)) {
            m[x - 1][y]++;
        }
        if (inRange(x + 1)) {
            m[x + 1][y]++;
        }
        if (inRange(y - 1)) {
            m[x][y - 1]++;
        }
        if (inRange(y + 1)) {
            m[x][y + 1]++;
        }
        break;
    case 2:
        for (int i = x - 1; i <= x + 1; ++i) {
            for (int j = y - 1; j <= y + 1; ++j) {
                if (inRange(i) && inRange(j)) {
                    m[i][j]++;
                }
            }
        }
        break;
    case 3:
        put(x, y, 2);
        if (inRange(x - 2)) {
            m[x - 2][y]++;
        }
        if (inRange(x + 2)) {
            m[x + 2][y]++;
        }
        if (inRange(y - 2)) {
            m[x][y - 2]++;
        }
        if (inRange(y + 2)) {
            m[x][y + 2]++;
        }
        break;
    }
}

int main() {
    int inx[100] = { 0 };
    int iny[100] = { 0 };
    int ins[100] = { 0 };
    int c;

    for (c = 0; scanf("%d,%d,%d", &inx[c], &iny[c], &ins[c]) != EOF; ++c) {}

    for (int i = 0; i < c; ++i) {
        put(inx[i], iny[i], ins[i]);
    }

    int mx = 0;
    int counts = 0;
    for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
            int p = m[i][j];
            if (mx < p) {
                mx = p;
            }

            if (p == 0) {
                counts++;
            }
        }
    }

    printf("%d\n%d\n", counts, mx);

    return 0;
}

C++: #include<iostream>
using namespace std;

void Small_Ink( int a[14][14], int x, int y );
void Middle_Ink( int a[14][14], int x, int y );
void Large_Ink( int a[14][14], int x, int y );

int main()
{
    int x, y, size;
    char p;

    //本来は10*10だが、大きい配列を確保して、はみ出したところを無視すればよい
    int paper[14][14] = {};         //0で初期化

    while( cin >> x >> p >> y >> p >> size )
    {
        if( size == 1 )
            Small_Ink( paper, x + 2, y + 2 );
        else if( size == 2 )
            Middle_Ink( paper, x + 2, y + 2 );
        else
            Large_Ink( paper, x + 2, y + 2 );
    }

    int cnt = 0, max = 0;
    for( int i = 2; i < 12; i++ )
    {
        for( int j = 2; j < 12; j++ )
        {
            if( max < paper[i][j] )
                max = paper[i][j];
            if( paper[i][j] == 0 )
                cnt++;
        }
    }

    cout << cnt << endl << max << endl;

    return 0;
}

void Small_Ink( int a[14][14], int x, int y )
{
    a[x][y]++;
    a[x-1][y]++;
    a[x+1][y]++;
    a[x][y-1]++;
    a[x][y+1]++;
}

void Middle_Ink( int a[14][14], int x, int y )
{
    Small_Ink( a, x, y );
    a[x-1][y-1]++;
    a[x-1][y+1]++;
    a[x+1][y-1]++;
    a[x+1][y+1]++;
}

void Large_Ink( int a[14][14], int x, int y )
{
    Middle_Ink( a, x, y );
    a[x-2][y]++;
    a[x+2][y]++;
    a[x][y-2]++;
    a[x][y+2]++;
}

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

#define SIZE 10

using namespace std;

int map[SIZE][SIZE];

void drop(int x, int y) {
	if (x < 0 || y < 0 || x >= SIZE || y >= SIZE) return;

	map[x][y]++;
}

int main() {
	int x, y, s, count = 0, most = 0;

	while (scanf("%d,%d,%d", &x, &y, &s)) {
		x--;
		y--;
		drop(x, y);
		drop(x, y + 1);
		drop(x + 1, y);
		drop(x, y - 1);
		drop(x - 1, y);

		if (s > 1) {
			drop(x + 1, y + 1);
			drop(x + 1, y - 1);
			drop(x - 1, y - 1);
			drop(x - 1, y + 1);

			if (s > 2) {
				drop(x, y + 2);
				drop(x, y - 2);
				drop(x + 2, y);
				drop(x - 2, y);
			}
		}
	}

	for (int i = 0; i < SIZE; i++) {
		for (int j = 0; j < SIZE; j++) {
			if (map[i][j] > most) {
				most = map[i][j];
			}

			if (map[i][j] == 0) {
				count++;
			}
		}
	}

	cout << count << endl << most << endl;
	return 0;
}