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>
using namespace std;

int main()
{
    int x,y,size,count=0,max=0;
    int dots[14][14]={{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0},{0}};
    while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
        x += 2;
        y += 2;
        dots[y][x]++;
        switch(size){
            case 1 :
                dots[y-1][x]++;
                dots[y][x+1]++;
                dots[y+1][x]++;
                dots[y][x-1]++;
                break;
            case 2 :
                dots[y-1][x]++;
                dots[y-1][x+1]++;
                dots[y][x+1]++;
                dots[y+1][x+1]++;
                dots[y+1][x]++;
                dots[y+1][x-1]++;
                dots[y][x-1]++;
                dots[y-1][x-1]++;
                break;
            case 3 :
                dots[y-1][x]++;
                dots[y-1][x+1]++;
                dots[y][x+1]++;
                dots[y+1][x+1]++;
                dots[y+1][x]++;
                dots[y+1][x-1]++;
                dots[y][x-1]++;
                dots[y-1][x-1]++;
                dots[y-2][x]++;
                dots[y][x+2]++;
                dots[y+2][x]++;
                dots[y][x-2]++;
                break;
        }
    }
    for(int i=2;i<12;i++){
        for(int j=2;j<12;j++){
            if(dots[i][j]==0){
                count++;
            }
            if(max<dots[i][j]){
                max=dots[i][j];
            }
        }
    }
    cout<<count<<endl<<max<<endl;
    return 0;
}

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);
}