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 <vector>
#include <string>
#include <algorithm>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define ct(string) cout << string << endl

int main() {
    ios::sync_with_stdio(false);
    vector<vector<int> > map(10, vector<int>(10, 0));
    rep(i,50) {
        int x, y, s;
        string raw;
        cin >> raw;
        if (raw=="") break;
        x = raw.at(0) - '0';
        y = raw.at(2) - '0';
        s = raw.at(4) - '0';
        map.at(x).at(y)++;
        if (x+1<10) map.at(x+1).at(y)++;
        if (y+1<10) map.at(x).at(y+1)++;
        if (x-1>(-1)) map.at(x-1).at(y)++;
        if (y-1>(-1)) map.at(x).at(y-1)++;
        if (s > 1) {
            if (x+1<10&&y+1<10) map.at(x+1).at(y+1)++;
            if (x+1<10&&y-1>(-1)) map.at(x+1).at(y-1)++;
            if (x-1>(-1)&&y-1>(-1)) map.at(x-1).at(y-1)++;
            if (x-1>(-1)&&y+1<10) map.at(x-1).at(y+1)++;
        } 
        if (s > 2) {
            if (x+2<10) map.at(x+2).at(y)++;
            if (x-2>(-1)) map.at(x-2).at(y)++;
            if (y+2<10) map.at(x).at(y+2)++;
            if (y-2>(-1)) map.at(x).at(y-2)++;
        }
    }
    int count=0,ma=0;
    rep(i,10) rep(j,10) {
        if (map.at(i).at(j) == 0) count++;
        ma = max(ma, map.at(i).at(j));
    }
    ct(count << endl << ma);
}

C++: #include<iostream>
#include<string>
int mem[14][14] = {}, i = 0, X[50], Y[50], S[50], flag = 0, max = 0, x, y, s;
int main() {
	char b;
	while (1) { 
		std::cin >> x >> b >> y >> b >> s;
		if (s == 0)
			break;
		Y[i] = y, S[i] = s, X[i] = x;
		i += 1;
	}
	for (int a = 0; a < i; a += 1) {
		if (S[a] >= 1) {
			mem[X[a] + 2][Y[a] + 2] += 1;
			mem[X[a] + 1][Y[a] + 2] += 1;
			mem[X[a] + 3][Y[a] + 2] += 1;
			mem[X[a] + 2][Y[a] + 1] += 1;
			mem[X[a] + 2][Y[a] + 3] += 1;
		}
		if (S[a] >= 2) {
			mem[X[a] + 1][Y[a] + 1] += 1;
			mem[X[a] + 1][Y[a] + 3] += 1;
			mem[X[a] + 3][Y[a] + 1] += 1;
			mem[X[a] + 3][Y[a] + 3] += 1;
		}
		if (S[a] >= 3) {
			mem[X[a]][Y[a] + 2] += 1;
			mem[X[a] + 4][Y[a] + 2] += 1;
			mem[X[a] + 2][Y[a] + 4] += 1;
			mem[X[a] + 2][Y[a]] += 1;
		}
	}
	for (int i = 0; i < 10; i += 1)
		for (int j = 0; j < 10; j += 1) {
			if (0 == mem[i + 2][j + 2])
				flag += 1;
			if (max < mem[i + 2][j + 2])
				max = mem[i + 2][j + 2];
		}
	std::cout << flag << std::endl;
	std::cout << max << std::endl;
	return 0;
}

C++: #include <math.h>
#include <stdio.h>

#pragma warning(disable : 4996)

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 (abs(i) + abs(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 (abs(i) + abs(j) <= 2)
					{
						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>
#include<cstdio>
using namespace std;
int main(){
  int x[10][10];
  int a,b,c;
  int yoso[3]={5,9,13};
  int tmp[3][2][13]={{{0,-1,0,1,0},{0,0,1,0,-1}},{{0,-1,-1,-1,0,1,1,1,0},{0,-1,0,1,1,1,0,-1,-1}},{{0,-1,-1,-1,0,1,1,1,0,-2,0,2,0},{0,-1,0,1,1,1,0,-1,-1,0,2,0,-2}}};
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      x[i][j]=0;
    }
  }

  while(scanf("%d,%d,%d",&b,&a,&c)!=EOF){
    c--;
    for(int i=0;i<yoso[c];i++){
      if(a+tmp[c][0][i]>=0&&a+tmp[c][0][i]<10&&b+tmp[c][1][i]>=0&&b+tmp[c][1][i]<10){
	x[a+tmp[c][0][i]][b+tmp[c][1][i]]++;
      }
    }
  }
  int cnt=0,max=0;
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(x[i][j]==0)cnt++;
      if(x[i][j]>max)max=x[i][j];
    }
  }
  cout << cnt << endl << max << endl;
}

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

int dx[12] = { 1, 0, -1, 0, 1, 1, -1, -1, 2, 0, -2, 0 };
int dy[12] = { 0, 1, 0, -1, -1, 1, 1, -1, 0, 2, 0, -2 };
int map[10][10];

inline bool out_of_range(int x, int y) {
	if (x<0||x>9||y<0||y>9) return false;
	return true;
}

inline void drop(int x, int y, int s) {
	for (int i=0; i<4*s; i++)
		map[y+dy[i]][x+dx[i]]++;
}

int main() {
	for (int i=0; i<10; i++)
	for (int j=0; j<10; j++)
		map[i][j] = 0;
	int x, y, s;
	char c;
	while (cin >> x >> c >> y >> c >> s) {
		drop(x, y, s);
	}

	int cnt=0,dep=0;
	for (int i=0; i<10; i++)
	for (int j=0; j<10; j++) {
		if (map[j][i]==0) cnt++;
		if (map[j][i] > dep) dep=map[j][i];
	}
	cout << cnt << endl << dep << endl;
	return 0;
}