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", count, max)
}

C++: #include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <sstream>
#include <complex>
#include <ctime>
#include <cassert>
#include <functional>
#include <list>
#include <bitset>
#include <cfenv>
#include <numeric>
#include <utility>
#include <cstdio>
#include <fstream>
#include <deque>
#include <limits>
#include <climits>
using namespace std;
typedef pair<int, int> ii;

int main() {
    ios::sync_with_stdio(false);

    string input, xS,yS, sizeS;
    int x, y, size;

    int grid[20][20];
    memset(grid, 0, sizeof(grid));

    while(getline(cin, input)) {

        // parse
        xS = input.substr(0, input.find_first_of(','));
        yS = input.substr(input.find_first_of(',') + 1, input.find_last_of(',') - input.find_first_of(','));
        sizeS = input.substr(input.find_last_of(',') + 1, input.size());

        stringstream parser;
        parser.str(xS);
        parser >> x;
        parser.clear();
        parser.str(yS);
        parser >> y;
        parser.clear();
        parser.str(sizeS);
        parser >> size;

        x += 5;
        y += 5;

        // simulate grid

        switch ( size ) {

                // large
            case 3: {
                // outer edges
                grid[x + 2][y]++;
                grid[x - 2][y]++;
                grid[x][y + 2]++;
                grid[x][y - 2]++;
            }
               //medium
            case 2: {

                // outer corners
                grid[x - 1][y - 1]++;
                grid[x + 1][y + 1]++;
                grid[x - 1][y + 1]++;
                grid[x + 1][y - 1]++;
            }
                // small
            case 1: {
                // cross shaped
                grid[x][y]++;
                grid[x - 1][y]++;
                grid[x + 1][y]++;
                grid[x][y - 1]++;
                grid[x][y + 1]++;
                break;
            }

        }
    }

    // find densest spot and number of clear spots
    int densest = 0;
    int clear = 0;

    for(int i = 5; i <= 14; i++) {
        for(int j = 5; j <= 14; j++) {
            if(grid[i][j] > densest)
                densest = grid[i][j];
            else if(grid[i][j] == 0)
                clear++;
        }
    }

    cout << clear << endl;
    cout << densest << endl;
    return 0;
}

C++: #include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int board[15][15];
int x,y,size;
int nx,ny;
int ans1,ans2;
int main()
{
  for(int i = 0;i <10;i++){
    for(int j = 0;j < 10;j++){
      board[j][i] = 0;
    }
  }
  while(scanf("%d,%d,%d",&x,&y,&size) !=EOF){
    if(size ==1){
      board[y][x] +=1;
      for(int i = 0;i < 4;i++){
	nx = x +dx[i];
	ny = y +dy[i];
	if(nx <0 ||nx >10||ny <0||ny >10)
	  continue;
	board[ny][nx] +=1;
      }
    }else if(size ==2){
      for(int i = -1;i <=1;i++){
	for(int j = -1;j <=1;j++){
	  nx = x +j;
	  ny = y +i;
	  if(nx <0 ||nx >=10||ny <0||ny >=10)
	    continue;
	  board[ny][nx] +=1;
	}
      }
    }else if(size ==3){
      for(int i = -2;i <=2;i++){
	for(int j = -2;j <=2;j++){
	  if(i == -2&&j ==0){
	    board[y+i][x] +=1;
	  }else if(i == -1&&(j !=-2&&j !=2)){
	    board[y+i][x+j] +=1;
	  }else if(i == 0){
	    board[y+i][x+j] +=1;
	  }else if(i == 1&&(j !=-2&&j !=2)){
	    board[y+i][x+j] +=1;
	  }else if(i ==2&&j ==0){
	    board[y+i][x] +=1;
	  }
	}
      }
    }
  }
  ans2 = 0; 
    for(int i = 0;i <10;i++){
      for(int j = 0;j < 10;j++){
	if(board[i][j] == 0){
	  ans1++;
	}
	if(board[i][j] > ans2){
	  ans2 = board[i][j];
	}
      }
    }
  cout <<ans1<<endl;
  cout <<ans2<<endl;
  return 0;
}

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

const int x1[]={1, 0, -1, 0};
const int y1[]={0, -1, 0, 1};
const int x2[]={1,  1, -1, -1};
const int y2[]={1, -1, -1,  1};
const int x3[]={2, 0, -2, 0};
const int y3[]={0, -2, 0, 2};

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int paper[10][10]={};
    int x, y, s;
    while(cin>>x){
        cin.ignore();
        cin>>y;
        cin.ignore();
        cin>>s;
        ++paper[y][x];
        int nx, ny;
        for(int i=0; i<4; i++){
            nx=x+x1[i];
            ny=y+y1[i];
            if(0<=nx&&nx<10&&0<=ny&&ny<10) ++paper[ny][nx];
            if(s>=2){
                nx=x+x2[i];
                ny=y+y2[i];
                if(0<=nx&&nx<10&&0<=ny&&ny<10) ++paper[ny][nx];
            }
            if(s>=3){
                nx=x+x3[i];
                ny=y+y3[i];
                if(0<=nx&&nx<10&&0<=ny&&ny<10) ++paper[ny][nx];
            }
        }
    }
    int max=0, count=0;
    for(int i=0; i<10; i++){
        for(int j=0; j<10; j++){
            if(paper[i][j]==0) ++count;
            else if(max<paper[i][j]) max=paper[i][j];
        }
    }
    cout<<count<<'\n'<<max<<'\n';
    return 0;
}