Go: package main

import (
        "fmt"
)

var paper [10][10]int

func main() {
        var x, y, s int
        for {
                _, err := fmt.Scanf("%d,%d,%d", &x, &y, &s)
                if err != nil {
                        break
                }

                fill(x, y, s)
        }
        var d, z int
        for i := 0; i < 10; i++ {
                for j := 0; j < 10; j++ {
                        if paper[i][j] == 0 {
                                z += 1
                        }
                        if paper[i][j] > d {
                                d += 1
                        }
                }
        }
        fmt.Printf("%d\n%d\n", z, d)
}

func fill(x int, y int, s int) {
        paper[x][y] += 1
        if x > 0 {
                paper[x-1][y] += 1
        }
        if x < 9 {
                paper[x+1][y] += 1
        }
        if y > 0 {
                paper[x][y-1] += 1
        }
        if y < 9 {
                paper[x][y+1] += 1
        }

        if s >= 2 {
                if x > 0 && y > 0 {
                        paper[x-1][y-1] += 1
                }
                if x > 0 && y < 9 {
                        paper[x-1][y+1] += 1
                }
                if x < 9 && y > 0 {
                        paper[x+1][y-1] += 1
                }
                if x < 9 && y < 9 {
                        paper[x+1][y+1] += 1
                }
        }

        if s > 2 {
                if x > 1 {
                        paper[x-2][y] += 1
                }
                if x < 8 {
                        paper[x+2][y] += 1
                }
                if y > 1 {
                        paper[x][y-2] += 1
                }
                if y < 8 {
                        paper[x][y+2] += 1
                }
        }
}

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

static int ans = 0;

void small(vector<vector<int> >& paper, int x, int y){
  x+=2; y+=2;
  paper[x][y]++;
  if(paper[x][y]>ans) ans = paper[x][y];
  paper[x-1][y]++;
  if(paper[x-1][y]>ans && x-1>=2) ans = paper[x-1][y];
  paper[x+1][y]++;
  if(paper[x+1][y]>ans && x+1<=11) ans = paper[x+1][y];
  paper[x][y-1]++;
  if(paper[x][y-1]>ans &&  y-1>=2) ans = paper[x][y-1];
  paper[x][y+1]++;
  if(paper[x][y+1]>ans && y+1<=11) ans = paper[x][y+1];
}

void medium(vector<vector<int> >& paper, int x, int y){
  small(paper, x, y);
  x+=2; y+=2;
  paper[x-1][y-1]++;
  if(paper[x-1][y-1]>ans && x-1>=2 && y-1>=2) ans = paper[x-1][y-1];
  paper[x-1][y+1]++;
  if(paper[x-1][y+1]>ans && x-1>=2 && y+1<=11) ans = paper[x-1][y+1];
  paper[x+1][y-1]++;
  if(paper[x+1][y-1]>ans && x+1<=11 && y-1>=2) ans = paper[x+1][y-1];
  paper[x+1][y+1]++;
  if(paper[x+1][y+1]>ans && x+1<=11 && y+1<=11) ans = paper[x+1][y+1];

}

void large(vector<vector<int> >& paper, int x, int y){
  medium(paper, x, y);
  x+=2; y+=2;
  paper[x][y-2]++;
  if(paper[x][y-2]>ans && y-2>=2) ans = paper[x][y-2];
  paper[x][y+2]++;
  if(paper[x][y+2]>ans && y+2<=11) ans = paper[x][y+2];
  paper[x-2][y]++;
  if(paper[x-2][y]>ans && x-2>=2) ans = paper[x-2][y];
  paper[x+2][y]++;
  if(paper[x+2][y]>ans && x+2<=11) ans = paper[x+2][y];
}

int main(){
  vector<vector<int> >paper(14,vector<int>(14));
  int x,y,size;
  string str;
  while(true){
    getline(cin,str);
    x = str[0]-'0';
    y = str[2]-'0';
    size = str[4]-'0';// cout << "OK\n";
    if(size == 1)
      small(paper,x,y);
    else if(size == 2)
      medium(paper,x,y);
    else
      large(paper,x,y);
    //    cout << "NOK\n";
  }
  cout << ans << endl;
  return 0;
}

C++: #include <cstdio>

int main(void)
{
    int x, y, size;
    int paper[10][10] = {0};
    int dx[] = { 0, 0,-1, 1,-1,-1, 1, 1, 0, 0,-2, 2};
	int dy[] = {-1, 1, 0, 0,-1, 1,-1, 1,-2, 2, 0, 0};
    int movex, movey;
    
    while (scanf("%d,%d,%d", &x, &y, &size) != EOF){
        paper[x][y]++;
        for (int i = 0; i < (size * 4); i++){
            movex = dx[i] + x;
            movey = dy[i] + y;
            if ((0 <= movex) && (movex <= 10) && (0 <= movey) && (movey <= 10)){
                paper[movex][movey]++;
            }
        }
    }
    int ans_white = 0;
    int ans_max = 0;
    for (int i = 0; i < 10; i++){
        for (int j = 0; j < 10; j++){
            if (paper[i][j] == 0) ans_white++;
            if (ans_max < paper[i][j]) ans_max = paper[i][j];
        }
    }
    
    printf("%d\n%d\n", ans_white, ans_max);
    
    return (0);
}

C++: #include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;

int dx[] = {-1, 1,  0, 0};
int dy[] = { 0, 0, -1, 1};
int density[10][10];

bool WithinRange(int y, int x) {
  if (y < 0) return false;
  if (y >= 10) return false;
  if (x < 0) return false;
  if (x >= 10) return false;
  return true;
}

int main() {
  while (1) {
    int x, y, t;
    if (scanf("%d,%d,%d", &x, &y, &t) != 3) break;
    if (t == 1) {
      for (int i=0; i<4; i++) {
        int newy = y+dy[i];
        int newx = x+dx[i];
        if (WithinRange(newy, newx)) density[newy][newx]++;
      }
    } else if (t == 2) {
      for (int i=-1; i<=1; i++) {
        for (int j=-1; j<=1; j++) {
          int newy = y+i;
          int newx = x+j;
          if (WithinRange(newy, newx)) density[newy][newx]++;
        }
      }
    } else if (t == 3) {
      for (int i=-2; i<=2; i++) {
        for (int j=-2; j<=2; j++) {
          if (abs(i)+abs(j) > 2) continue;

          int newy = y+i;
          int newx = x+j;
          if (WithinRange(newy, newx)) density[newy][newx]++;
        }
      }
    }
  }

  int ans = 0;
  int mans = 0;
  for (int i=0; i<10; i++) { 
    for (int j=0; j<10; j++) {
      if (density[i][j] == 0) ans++;
      mans = max(density[i][j], mans);
    }
  }
  printf("%d\n", ans);
  printf("%d\n", mans);
}