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++:  // compile in C++11. use -std=c++11.
#include <iostream>
#include <iomanip>
#include <vector>
#include <valarray>
#include <map>
#include <set>
#include <list>
#include <queue>
#include <stack>
#include <bitset>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <complex>
#include <string>
#include <sstream>

#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cstring>

// this require C++11
#include <unordered_set>
#include <unordered_map>
#include <random>

using namespace std;

#define all(c) c.begin(),c.end()
#define repeat(i,n) for(int i=0;i<static_cast<int>(n);i++)
#define debug(x) #x << "=" << (x)
#define dump(x) cerr << debug(x) << " (L:" << __LINE__ << ")"<< endl

typedef long long ll;
typedef vector<int> vi;

template<typename T>
ostream& operator<<(ostream& os,const vector<T>& vec){
    os << "[";
    for(const auto& v : vec){
        os << v << ",";
    }
    os << "]";
    return os;
}

template<typename T>
T input(){
    T t;cin >> t;
    return t;
}

template<typename T>
vector<T> input(const int N){
    vector<T> v(N);
    repeat(i,N) cin >> v[i];
    return v;
}

int main(){
    const int FIELD_SIZE = 10;
    const int PADDING = 2;
    const int DATA_SIZE = FIELD_SIZE + 2*PADDING;
    vector<vi> field(DATA_SIZE,vi(DATA_SIZE));
    {
        int y,x,size;char comma;
        while(cin >> x >> comma >> y >> comma >> size){
            x += PADDING;
            y += PADDING;

            field[y][x] += 1;
            vi dx,dy;
            if(size == 1){
                dx = {1,0,-1,0};
                dy = {0,-1,0,1};
            }else{
                for(int i=-1;i<=1;i++){
                    for(int j=-1;j<=1;j++){
                        if(i == 0 and j == 0) continue;
                        dx.push_back(i);
                        dy.push_back(j);
                    }
                }
                if(size == 3){
                    vi ax = {2,0,-2,0};
                    vi ay = {0,-2,0,2};
                    repeat(i,4){
                        dx.push_back(ax[i]);
                        dy.push_back(ay[i]);
                    }
                }
            }
            repeat(i,dx.size()){
                field[y+dy[i]][x+dx[i]]++;
            }
        }
    }

    int maxi = -1;
    int no = 0;

    for(int y=PADDING;y<FIELD_SIZE+PADDING;y++){
        for(int x=PADDING;x<FIELD_SIZE+PADDING;x++){
            maxi = max(maxi,field[y][x]);
            no += field[y][x]==0;
        }
    }

    cout << no << endl << maxi << endl;

    return 0;
}

C++: #include<iostream>
#include<stdio.h>
#include<math.h>
#include<vector>
using namespace std;
int main() {
	int i,j,k,l,m,n,o,x,y,z;
	int max = 0;
	int count = 0;
	vector< vector<int> > s;
	s.resize(14);
	for (i = 0; i < 14; i++) {
		s[i].resize(14);
	}
	for (j = 0; j < 14; j++) {
		for (k = 0; k < 14; k++) {
			s[j][k] = 0;
		}
	}
	while (scanf("%d,%d,%d", &x, &y, &z)!=EOF) {
		if (z == 1) {
			s[x + 2][y + 2] += 1;
			s[x + 1][y + 2] += 1;
			s[x + 3][y + 2] += 1;
			s[x + 2][y + 1] += 1;
			s[x + 2][y + 3] += 1;
		}
		else if (z == 2) {
			for (l = x + 1; l <= x + 3; l++) {
				for (m = y + 1; m <= y + 3; m++) {
					s[l][m] += 1;
				}
			}
		}
		else if (z == 3) {
			for (l = x + 1; l <= x + 3; l++) {
				for (m = y + 1; m <= y + 3; m++) {
					s[l][m] += 1;
				}
			}
			s[x][y + 2] += 1;
			s[x + 4][y + 2] += 1;
			s[x + 2][y] += 1;
			s[x + 2][y + 4] += 1;
		}
	}
	for (n = 2; n < 12; n++) {
		for (o = 2; o < 12; o++) {
			if (max < s[n][o]) {
				max = s[n][o];
			}
			if (s[n][o] == 0) {
				count += 1;
			}
		}
	}
	cout << count << endl;
	cout << max << endl;
	return 0;
}

C++: void dfs1(int x, int y) {
  field[y][x] += 1;
  for(int dx = -1 ; dx <= 1 ; dx++) {
    int nx = x + dx;
    if(0 <= nx && nx < 10 && nx != x) field[y][nx] += 1;
  }
  for(int dy = -1 ; dy <= 1 ; dy++) {
    int ny = y + dy;
    if(0 <= ny && ny < 10 && ny != y) field[ny][x] += 1;
  }
}

void dfs2(int x, int y) {
  field[y][x] += 1;
  if(y+1 < 10) field[y+1][x] += 1;
  if(y-1 >= 0) field[y-1][x] += 1;
  if(x+1 < 10) field[y][x+1] += 1;
  if(x-1 >= 0) field[y][x-1] += 1;
  for(int dx = -1 ; dx <= 1 ; dx++) {
    for(int dy = -1 ; dy <= 1 ; dy++) {
      int nx = x + dx, ny = y + dy;
      if(0 <= nx && nx < 10 && 0 <= ny && ny < 10 && nx != x && ny != y) field[ny][nx] += 1;
    }
  }
}

void dfs3(int x, int y) {
  field[y][x] += 1;
  if(y+2 < 10) field[y+2][x] += 1;
  if(y-2 >= 0) field[y-2][x] += 1;
  if(x+2 < 10) field[y][x+2] += 1;
  if(x-2 >= 0) field[y][x-2] += 1;
  if(y+1 < 10) field[y+1][x] += 1;
  if(y-1 >= 0) field[y-1][x] += 1;
  if(x+1 < 10) field[y][x+1] += 1;
  if(x-1 >= 0) field[y][x-1] += 1;
  for(int dx = -1 ; dx <= 1 ; dx++) {
    for(int dy = -1 ; dy <= 1 ; dy++) {
      int nx = x + dx, ny = y + dy;
      if(0 <= nx && nx < 10 && 0 <= ny && ny < 10 && nx != x && ny != y) field[ny][nx] += 1;
    }
  }
}

int main(void) {
  int x, y, size;
  char c1, c2;
  int max=0;
  int white=0;
  while(cin >> x >> c1  >> y >> c2 >> size) {
    if(size == 1) dfs1(x, y);
    if(size == 2) dfs2(x, y);
    if(size == 3) dfs3(x, y);
  }
  /*for(int i = 0 ; i < 10 ; i++) {
    for(int j = 0 ; j < 10 ; j++) {
      cout << field[i][j] << ' ';
    }
    cout << endl;
    }*/
  for(int i = 0 ; i < 10 ; i++) {
    for(int j = 0 ; j < 10 ; j++) {
      if(field[i][j] > max) max = field[i][j];
      if(field[i][j] == 0) white++;
    }
  }
  cout << white << endl;
  cout << max << endl;
  return 0;
}