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 <cstdio>
#include <algorithm>
using namespace std;

int main()
{
	int paper[10][10] = {{0}};
	int vecx[] = {0, 1, 0, -1};
	int vecy[] = {-1, 0, 1, 0};
	
	int x, y, size;
	while( scanf("%d, %d, %d", &x, &y, &size) != EOF ){
		switch( size ){
			case 1:
				paper[x][y]++;
				for(int i=0;i<4;i++){
					int nx = x + vecx[i];
					int ny = y + vecy[i];
					
					if(nx >= 0 && nx < 10 && ny >=0 && ny <10){
						paper[nx][ny]++;
					}
				}
				break;
				
			case 2:
				for(int i=-1;i<=1;i++){
					for(int j=-1;j<=1;j++){
						int nx = x + i;
						int ny = y + j;
						
						if(nx >= 0 && nx <10 && ny >= 0 && ny <10){
							paper[nx][ny]++;
						}
						
					}
				}
				break;
				
			case 3:
				for(int i=-1;i<=1;i++){
					for(int j=-1;j<=1;j++){
						int nx = x + i;
						int ny = y + j;
						
						if(nx >= 0 && nx < 10 && ny >= 0 && ny < 10){
							paper[nx][ny]++;
						}
					}
				}
				for(int i=0;i<4;i++){
					int nx = x + vecx[i]*2;
					int ny = y + vecy[i]*2;
					
					if(nx >= 0 && nx < 10 && ny >= 0 && ny < 10){
						paper[nx][ny]++;
					}
				}
				break;
			}
		
	}
	
	int plain = 0, max_c = 0;
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			if( !paper[i][j]){
				plain++;
			}
			max_c = max( max_c, paper[i][j]);
		}
	}
	cout<<plain<<endl;
	cout<<max_c<<endl;
	
	return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cstdio>
#define N 13
#define N1 3
#define N2 2
using namespace std;
void Drop(int,int,int);
int data[N][N];
int dy[N1]={-1,0,1};int dx[N1]={-1,0,1};
int dy2[N2]={-1,1};int dx2[N2]={-1,1};
int dy3[N1+1]={-2,0,2,0};int dx3[N1+1]={0,2,0,-2};
int main(){
  int x,y,size,maxv=0,cnt=0;
  while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
    Drop(y+2,x+2,size);
  }
  for(int i=2;i<N-1;i++){
    for(int j=2;j<N-1;j++){
      maxv=max(maxv,data[i][j]);
      if(data[i][j]==0) cnt++;
    }
  }
  cout << cnt << endl << maxv << endl;
  return 0;
}
void Drop(int y,int x,int size){
  for(int i=0;i<N1;i++)
    for(int j=0;j<N1;j++)
      data[y+dy[i]][x+dx[j]]++;
  if(size==1)
    for(int i=0;i<N2;i++)
      for(int j=0;j<N2;j++)
	data[y+dy2[i]][x+dx2[j]]--;
  if(size==3)
    for(int i=0;i<N1+1;i++)
      data[y+dy3[i]][x+dx3[i]]++;
}

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

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

void small_ink(int x,int y){
  paper[y][x]++;
  if(x+1<10)paper[y][x+1];
  if(x-1>=0)paper[y][x-1];
  if(y+1<10)paper[y+1][x];
  if(y-1>=0)paper[y-1][x];
}
void midium_ink(int x,int y){
  for(int i=-1;i<2;i++){
    for(int j=-1;i<2;j++){
      if(y+i>=0 && y+i<10 && x+j>=0 && x+j<10)paper[y+i][x+j]++;
    }
  }
}
void big_ink(int x,int y){
  for(int i=-1;i<2;i++){
    for(int j=-1;i<2;j++){
      if(y+i>=0 && y+i<10 && x+j>=0 && x+j<10)paper[y+i][x+j]++;
    }
  }
  for(int i=-1;i<2;i=i+2){
    for(int j=-1;j<2;j=j+2){
      if(y+i*2>=0 && y+i*2<10 && x+j*2>=0 && x+j*2<10)paper[y+i*2][x+j*2]++;
    }
  }
}

int main(){
  int x,y,s;
  int white=0;
  int darkest=0;
  while(scanf("%d,%d,%d",&x,&y,&s)!=EOF){
    if(s==1)small_ink(x,y);
    else if(s==2)midium_ink(x,y);
    else if(s==3)big_ink(x,y);
  }
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(paper[i][j]==0)white++;
      if(paper[i][j]>darkest)darkest=paper[i][j];
    }
  }
  cout<<white<<endl<<darkest<<endl;
}

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) != EOF){
    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;
}