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 <stdio.h>

#define SIZE 10

int paper[SIZE][SIZE];

void exist(int x, int y)
{
	if(x >= 0 && x < 10 && y >= 0 && y < 10) paper[x][y]++;
}

int main()
{
	int x, y, s, i, j, zero_count, max;

	zero_count = 0;
	max = 0;

	for(i = 0; i < SIZE; i++){
		for(j = 0; j < SIZE; j++){
			paper[i][j] = 0;
		}
	}

	while(scanf("%d,%d,%d", &x, &y, &s) != EOF){
		switch(s){
			case 1:
				exist(x, y);
				exist(x-1, y);
				exist(x, y-1);
				exist(x+1, y);
				exist(x, y+1);
				break;
			case 2:
				for(i = 0; i < 3; i++){
					for(j = 0; j < 3; j++){
						exist(x+i-1, y+j-1);
					}
				}
				break;
			case 3:
				for(i = 0; i < 3; i++){
					for(j = 0; j < 3; j++){
						exist(x+i-1, y+j-1);
					}
				}

				exist(x-2, y);
				exist(x, y-2);
				exist(x+2, y);
				exist(x, y+2);
				break;
		}
	}

	for(i = 0; i < SIZE; i++){
		for(j = 0; j < SIZE; j++){
			printf("%2d", paper[j][i]);
			if(paper[j][i] == 0) zero_count++;
			if(paper[j][i] > max) max = paper[j][i];
		}
		printf("\n");
	}

	printf("%d\n%d\n", zero_count, max);

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>	// require sort next_permutation count __gcd reverse etc.
#include <cstdlib>	// require abs exit atof atoi 
#include <cstdio>		// require scanf printf
#include <functional>
#include <numeric>	// require accumulate
#include <cmath>		// require fabs
#include <climits>
#include <limits>
#include <cfloat>
#include <iomanip>	// require setw
#include <sstream>	// require stringstream 
#include <cstring>	// require memset
#include <cctype>		// require tolower, toupper
#include <fstream>	// require freopen
#include <ctime>		// require srand
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(A) A.begin(), A.end()

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
int density[15][15];
const int dr[] = { 0,-1, 0, 1, 0 };
const int dc[] = { 0, 0, 1, 0,-1 };

int main()
{
//	cut here before submit 
//	freopen ("testcase.DI", "r", stdin );
	memset (density, 0, sizeof (density ) );
	string str = "";
	while (getline (cin, str ) ){
		int n = str.length();
		rep (i, n ){
			if (str[i] == ',' ) str[i] = ' ';
		} // end rep
		stringstream ss (str );
		int col, row, size;
		ss >> col >> row >> size;
		switch (size ){
			case 1:	// small
				rep (k, 5 ){
					int nr = row + dr[k];
					int nc = col + dc[k];
					if (nr < 0 || nr >= 10 || nc < 0 || nc >= 10 ) continue;
					density[nr][nc]++;
				} // end rep
				break;
			case 2:	// medium
				for (int drow = -1; drow <= 1; drow++ ){
					for (int dcol = -1; dcol <= 1; dcol++ ){
						int nr = row + drow;
						int nc = col + dcol;
						if (nr < 0 || nr >= 10 || nc < 0 || nc >= 10 ) continue;
						density[nr][nc]++;
					} // end for
				} // end for
				break;
			case 3:	// large
				for (int drow = -1; drow <= 1; drow++ ){
					for (int dcol = -1; dcol <= 1; dcol++ ){
						int nr = row + drow;
						int nc = col + dcol;
						if (nr < 0 || nr >= 10 || nc < 0 || nc >= 10 ) continue;
						density[nr][nc]++;
					} // end for
				} // end for
				for (int k = 1; k < 5; k++ ){
					int nr = row + 2*dr[k];
					int nc = col + 2*dc[k];
					if (nr < 0 || nr >= 10 || nc < 0 || nc >= 10 ) continue;
					density[nr][nc]++;
				} // end for
				break;
		} // end switch
	} // end while
	int noink = 0;
	int max_density = 0;
	rep (i, 10 ) rep (j, 10 ){
		if (density[i][j] == 0 ) noink++;
		else
			max_density = max (max_density, density[i][j] );
	} // end rep
	cout << noink << endl;
	cout << max_density << endl;
		
	return 0;
}

C++: #include <iostream>
#include <algorithm>
using namespace std;
int dir[][2] = {{0, 0}, {1, 0}, {0, 1}, {-1, 0}, {0, -1}, {1, 1}, {1, -1}, {-1,
  1}, {-1, -1}, {2, 0}, {0, 2}, {-2, 0}, {0, -2}};
int map[10][10], dens = 0, rest = 100;
void drop(int x, int y) {
  if (0 <= x && x < 10 && 0 <= y && y < 10) {
    if (map[x][y]++ == 0) rest--;
    dens = max(map[x][y], dens);
  }
}
int main() {
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      map[i][j] = 0;
  int x, y, size;
  char c;
  while (cin >> x >> c >> y >> c >> size)
    for (int i = 0; i <= 4 * size; i++)
      drop(x + dir[i][0], y + dir[i][1]);
  cout << rest << endl << dens << endl;
}

C++: #include<stdio.h>
int dx[4]={-1,0,0,1};
int dy[4]={0,1,-1,0};
int dx2[8]={-1,-1,-1,0,1,1,1,0};
int dy2[8]={-1,0,1,1,1,0,-1,-1};
int dx3[12]={-1,-1,-1,0,1,1,1,0,-2,0,2,0};
int dy3[12]={-1,0,1,1,1,0,-1,-1,0,2,0,-2};
int main(){
	int t[14][14];
	int i,j;
	for(i=0;i<14;i++)for(j=0;j<14;j++)t[i][j]=0;
	int a,b,c;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		t[a+2][b+2]++;
		if(c==1)for(i=0;i<4;i++)t[a+dx[i]+2][b+dy[i]+2]++;
		if(c==2)for(i=0;i<8;i++)t[a+dx2[i]+2][b+dy2[i]+2]++;
		if(c==3)for(i=0;i<12;i++)t[a+dx3[i]+2][b+dy3[i]+2]++;
	}
	int ans1=0;
	int ans2=0;
	for(i=2;i<12;i++){
		for(j=2;j<12;j++){
			if(t[i][j]>0)ans1++;
			if(ans2<t[i][j])ans2=t[i][j];
		}
	}
	printf("%d\n%d\n",100-ans1,ans2);
	return 0;
}

C++: #include <iostream>
#define rep(i,a) for(int i=0;i<(a);i++)

using namespace std;
int f[30][30]={},x,y,size;

void n(){
    int dx[13]={0,1,-1,0,0,-1,-1,1,1,0,0,2,-2},dy[13]={0,0,0,1,-1,1,-1,1,-1,2,-2,0,0};
    rep(i,4*size+1)f[y+dy[i]+10][x+dx[i]+10]+=1;
    
}

int main(){
    char z;
    while(cin>>x>>z>>y>>z>>size){
        n();
    }
    int m=0,c=0;
    rep(i,10)
        rep(j,10)
            if(f[i+10][j+10]==0)c++;
                else m=max(m,f[i+10][j+10]);
    cout<<c<<endl<<m<<endl;
    return 0;
}