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<algorithm>
using namespace std;
int x,y,size,maxm,cnt;
int t[10][10];
char ch;
void pl(int y,int x){
  if(y<0||y==10||x<0||x==10)return;
  t[y][x]++;
  maxm=max(maxm,t[y][x]);
}

int main(){
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      t[i][j]=0;
  maxm=-1;
  while(cin>>x>>ch>>y>>ch>>size){
    if(size==1){
      pl(y,x);pl(y+1,x);pl(y-1,x);pl(y,x+1);pl(y,x-1);
    }else if(size==2){
      for(int i=y-1;i<y+2;i++){
	for(int j=x-1;j<x+2;j++){
	  pl(i,j);
	}
      }
    }else{
      for(int i=y-1;i<y+2;i++){
	for(int j=x-1;j<x+2;j++){
	  pl(i,j);
	}
      }
      pl(y+2,x);pl(y-2,x);pl(y,x+2);pl(y,x-2);
    }
  }
  cnt=0;
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      if(t[i][j]==0)cnt++;
  cout<<cnt<<endl;
  cout<<maxm<<endl;
  return 0;
}

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

typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
#define rrep(i, m, n) for(int (i)=(m); (i)<(n);  (i)++)
#define erep(i, m, n) for(int (i)=(m); (i)<=(n); (i)++)
#define  rep(i, n)    for(int (i)=0; (i)<(n);  (i)++)
#define  rev(i, n)    for(int (i)=(n)-1; (i)>=0; (i)--)
#define vrep(i, c)    for(__typeof((c).begin())i=(c).begin(); i!=(c).end(); i++)
#define  ALL(v)       (v).begin(), (v).end()
#define mp            make_pair
#define pb            push_back
template<class T1, class T2> inline void minup(T1& m, T2 x){ if(m>x) m=static_cast<T2>(x); }
template<class T1, class T2> inline void maxup(T1& m, T2 x){ if(m<x) m=static_cast<T2>(x); }

#define INF 1000000000
#define MOD 1000000009
#define EPS 1E-9

const int MAX_H = 10;
const int MAX_W = 10;
int m[MAX_H][MAX_W];
int x, y ,s;
int cnt = MAX_H * MAX_W;
int mx;

inline bool check(int x, int y){ return 0<=x&&x<MAX_H && 0<=y&&y<=MAX_W; }

void dfs(int x, int y)
{
  maxup(mx, m[x][y]);
  m[x][y] = 0;
  cnt -= 1;
  erep(dx, -1, 1) erep(dy, -1, 1) if(check(x+dx, y+dy)) if(m[x+dx][y+dy]) dfs(x+dx, y+dy);
}

int main()
{
  while(scanf(" %d,%d,%d", &x, &y, &s) == 3){
    m[x][y] += 1;
    if(s%2){
      int d = s/2 + 1;
      int dx[] = {-d, 0, d, 0};
      int dy[] = {0, -d, 0, d};
      rep(i, 4) if(check(x+dx[i], y+dy[i])) m[x+dx[i]][y+dy[i]] += 1;
    }
    if(s-1){
      erep(i, -1, 1) erep(j, -1, 1) if(i || j) if(check(x+i, y+j)) m[x+i][y+j] += 1;
    }
  }

  rep(i, MAX_H) rep(j, MAX_W) if(m[i][j]) dfs(i, j);

  cout << cnt << endl << mx << endl;

  return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int mas[10][10]={0};
  int dx1[5]={1,0,0,0,-1},dx2[9]={1,1,1,0,0,0,-1,-1,-1},dx3[13]={2,1,1,1,0,0,0,0,0,-1,-1,-1,-2};
  int dy1[5]={0,0,1,-1,0},dy2[9]={1,0,-1,1,0,-1,1,0,-1},dy3[13]={0,1,0,-1,2,1,0,-1,-2,1,0,-1,0};
  int x,y,size,nx,ny,bell=0,hess=0;
  while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
    if(size==1){
      for(int i=0;i<5;i++){
	nx=x+dx1[i];
        ny=y+dy1[i];
	if(nx>=0 && nx<10 && ny>=0 && ny<10){
	  mas[ny][nx]++;
	}
      }
    }
    else if(size==2){
      for(int i=0;i<9;i++){
	nx=x+dx2[i];
	ny=y+dy2[i];
	if(nx>=0 && nx<10 && ny>=0 && ny<10){
	  mas[ny][nx]++;
	}
      }
    }
    else if(size==3){
      for(int i=0;i<13;i++){
	nx=x+dx3[i];
	ny=y+dy3[i];
	if(nx>=0 && nx<10 && ny>=0 && ny<10){
	  mas[ny][nx]++;
	}
      }
    }
    /*for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
      cout << mas[i][j];
      }
      cout << endl;
      }*/
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(mas[i][j]>bell){
	bell=mas[i][j];
      }
      if(mas[i][j]==0){
	hess++;
      }
    }
  }
  cout << hess << endl << bell << endl;
  return (0);
}

C++: #include <bits/stdc++.h>
using namespace std;
int paper[10][10];
const int dx[] = { 0, 0, -1, 1, -1, -1,  1, 1,  0, 0, -2, 2};
const int dy[] = {-1, 1,  0, 0, -1,  1, -1, 1, -2, 2,  0, 0};

int main() {
  int x, y, s;
  char c;
  while (cin >> x >> c >> y >> c >> s) {
    paper[y][x]++;
    for (int i = 0; i < s * 4; i++) {
      int px = x + dx[i];
      int py = y + dy[i];
      if (px >= 0 && px < 10 && py >= 0 && py < 10){
        paper[py][px]++;
      }
    }
  }
  int num_of_cells = 0, max_density = 0;
  for (int i = 0; i < 10; i++)
  {
    for (int j = 0; j < 10; j++)
    {
      if (paper[j][i] == 0) num_of_cells++;
      max_density = max(paper[j][i], max_density);
    }
  }
  cout << num_of_cells << "\n" << max_density << "\n";
}