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++: #ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

#include <array>

using namespace std;

int data[10][11] = {};

int main ()
{
	int a , b , c;
	char d;
	while( cin >> a >> d >> b >> d >> c )
	{
		if( c == 1 )
		{
			if( a - 1 >= 0 )
			{
				data[a - 1][b]++;
				data[a - 1][b + 1]--;
			}
			data[a][max ( b - 1 , 0 )]++;
			data[a][min ( b + 2 , 10 )]--;
			if( a + 1 < 10 )
			{
				data[a + 1][b]++;
				data[a + 1][b + 1]--;
			}
		} else if( c == 2 )
		{
			if( a - 1 >= 0 )
			{
				data[a - 1][max ( b - 1 , 0 )]++;
				data[a - 1][min ( b + 2 , 10 )]--;
			}
			data[a][max ( b - 1 , 0 )]++;
			data[a][min ( b + 2 , 10 )]--;
			if( a + 1 < 10 )
			{
				data[a + 1][max ( b - 1 , 0 )]++;
				data[a + 1][min ( b + 2 , 10 )]--;
			}
		} else
		{
			if( a - 2 >= 0 )
			{
				data[a - 2][b]++;
				data[a - 2][b + 1]--;
			}
			if( a - 1 >= 0 )
			{
				data[a - 1][max ( b - 1 , 0 )]++;
				data[a - 1][min ( b + 2 , 10 )]--;
			}
			data[a][max ( b - 2 , 0 )]++;
			data[a][min ( b + 3 , 10 )]--;
			if( a + 1 < 10 )
			{
				data[a + 1][max ( b - 1 , 0 )]++;
				data[a + 1][min ( b + 2 , 10 )]--;
			}
			if( a + 2 < 10 )
			{
				data[a + 2][b]++;
				data[a + 2][b + 1]--;
			}
		}
	}
	int ans1 = 0 , ans2 = 0;
	for( size_t i = 0; i < 10; i++ )
	{
		for( size_t j = 1; j < 11; j++ )
		{
			data[i][j] += data[i][j - 1];
			if( data[i][j] == 0 )
			{
				ans1++;
			}
			if( ans2 < data[i][j] )
			{
				ans2 = data[i][j];
			}
		}
	}
	cout << ans1 << endl << ans2 << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int cnt[10][10];
 
int main() {
    int x, y, s; char c;
    while(cin >> x >> c >> y >> c >> s) {
        for(int i = 0; i < 10; i ++)
            for(int j = 0; j < 10; j ++)
                if(s == 2) {
                    if(abs(x - i) <= 1 && abs(y - j) <= 1)
                        cnt[i][j] ++;
                } else {
                    if(abs(x - i) + abs(y - j) <= s / 2 + 1)
                        cnt[i][j] ++;
                }
    }
    auto a = (int*)cnt;
    cout << count(a, a + 100, 0) << '\n';
    cout << *max_element(a, a + 100) << '\n';
    return 0;
}

C++: #include <iostream>
#include <vector>

using namespace std;
constexpr int paper_w=10,paper_h=10;
constexpr int ink_w=5,ink_h=5;
int inkarea[3][ink_h][ink_w]={
  0,0,0,0,0,
  0,0,1,0,0,
  0,1,1,1,0,
  0,0,1,0,0,
  0,0,0,0,0,

  0,0,0,0,0,
  0,1,1,1,0,
  0,1,1,1,0,
  0,1,1,1,0,
  0,0,0,0,0,

  0,0,1,0,0,
  0,1,1,1,0,
  1,1,1,1,1,
  0,1,1,1,0,
  0,0,1,0,0
};

int main(){
  int paper[paper_h][paper_w]={0};
  int x,y,size;
  char c;
  while(cin>>x>>c>>y>>c>>size){
    for(int i=0;i<ink_h;i++){
      for(int j=0;j<ink_w;j++){
        int ink_x=x+j-2,ink_y=y+i-2;
        if(ink_y<0||paper_h<=ink_y||ink_x<0||paper_w<=ink_x)
          continue;
        paper[ink_y][ink_x]+=inkarea[size-1][i][j];
      }
    }
  } 
  int white=0,density=0;
  for(int i=0;i<paper_h;i++){
    for(int j=0;j<paper_w;j++){
      if(!paper[i][j])
        white++;
      if(density<paper[i][j])
        density=paper[i][j];
    }
  }
  cout<<white<<endl;
  cout<<density<<endl;

}