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<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<random>
using namespace std;

int main(){

  int s1x[4] = {0, 1, 0, -1};
  int s1y[4] = {1, 0, -1, 0};

  int s2x[8] = {0, 1, 0, -1, 1, 1, -1, -1};
  int s2y[8] = {1, 0, -1, 0, 1, -1, 1, -1};

  int s3x[12] = {0, 1, 0, -1, 1, 1, -1, -1, 0, 2, 0, -2};
  int s3y[12] = {1, 0, -1, 0, 1, -1, 1, -1, 2, 0, -2, 0};


  vector< vector<int> > p( 10, vector<int> (10, 0) );
  int x, y, s;
  int cnt = 0;
  int mx = 0;
  // while( cin >> x >> y >> s ){
  while( scanf("%d,%d,%d\n", &x, &y, &s) != EOF ){
    if( s == 1 ){
      p[ x ][ y ]++;
      cnt++;
      for(int i=0; i<4; i++){
        int tx = x + s1x[i];
        int ty = y + s1y[i];
        if( tx < 0 || ty < 0 || tx >= 10 || ty >= 10 ) continue;
        p[tx][ty]++;
        cnt++;
        mx = max(mx, p[tx][ty]);
      }
    }else if( s == 2 ){
      p[ x ][ y ]++;
      cnt++;
      for(int i=0; i<8; i++){
        int tx = x + s2x[i];
        int ty = y + s2y[i];
        if( tx < 0 || ty < 0 || tx >= 10 || ty >= 10 ) continue;
        p[tx][ty]++;
        cnt++;
        mx = max(mx, p[tx][ty]);
      }
    }else if( s == 3 ){
      p[ x ][ y ]++;
      cnt++;
      for(int i=0; i<12; i++){
        int tx = x + s3x[i];
        int ty = y + s3y[i];
        if( tx < 0 || ty < 0 || tx >= 10 || ty >= 10 ) continue;
        p[tx][ty]++;
        cnt++;
        mx = max(mx, p[tx][ty]);
      }
    }
    cerr << cnt << endl;
  }
  cout << cnt << endl;

  return 0;
}




// EOF

C++: #include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>

#define MEMZERO(x) memset(x, 0, sizeof(x));

using namespace std;

int main ( void )
{
	const int dx[] = { 0, 0, 0, -1, 1, -1, 1, -1, 1, 0, 0, -2, 2 };
	const int dy[] = { 0, -1, 1, 0, 0, -1, -1, 1, 1, -2, 2, 0, 0 };
	int p[10][10];
	int x, y, s;
	
	MEMZERO(p);
	
	while(~scanf("%d,%d,%d", &x, &y, &s))
	{
		s *= 4;
		for ( int i = 0; i <= s; ++i )
		{
			int mx = x + dx[i];
			int my = y + dy[i];
			if ( 0 <= mx && mx < 10 && 0 <= my && my < 10 )
			{
				++p[my][mx];
			}
		}
	}
	
	int cnt = 0, val = 0;
	
	for ( int i = 0; i < 10; ++i )
		for ( int j = 0; j < 10; ++j )
			if(!p[i][j])
				++cnt;
			else
				val = max(val, p[i][j]);
	cout << cnt << endl << val << endl;
	
	return 0;
}

C++: #include <iostream>

using namespace std;

const int SMALL = 1;
const int MIDDLE = 2;
const int BIG = 3;
int paper[10][10] = {0};

void Dropping_Ink(int x, int y, int size)
{
		if(x-1 > -1)    paper[y][x-1]++;
		if(x+1 < 10)    paper[y][x+1]++;
		if(y-1 > -1)    paper[y-1][x]++;
		if(y+1 < 10)    paper[y+1][x]++;

		if(size >= MIDDLE)
		{
			if(x-1 > -1)
			{
				if(y-1 > -1)    paper[y-1][x-1]++;
				if(y+1 < 10)    paper[y+1][x-1]++;
			}
			if(x+1 < 10)
			{
				if(y-1 > -1)    paper[y-1][x+1]++;
				if(y+1 < 10)    paper[y+1][x+1]++;
			}
		}

		if(size >= BIG)
		{
			if(x-2 > -1)    paper[y-2][x]++;
			if(x+2 < 10)    paper[y+2][x]++;
			if(y-2 > -1)    paper[y][x-2]++;
			if(y+2 < 10)    paper[y][x+2]++;
		}
}

int main()
{
	int x, y, size, white, color;
	char c;

	while(cin >> x >> c >> y >> c >> size)
	{
		if(cin.eof())    break;

		Dropping_Ink(x, y, size);

		white = 0;
		color = 0;	
	
		for(int i=0; i<10; i++)
		{
			for(int j=0; j<10; j++)
			{
				if(paper[i][j] == 0)    white++;
				if(paper[i][j] > color)    color = paper[i][j];
			}
		}	
	}

	cout << white << endl << color << endl;
	
	return 0;
}

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


int main(){
	int vx[]={ 0, 1,-1, 0, 0,-1,-1, 1, 1, 2,-2, 0, 0};
	int vy[]={ 0, 0, 0, 1,-1,-1, 1,-1, 1, 0, 0, 2,-2};
	int x,y,size;
	int map[10][10];
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			map[i][j]=0;
		}
	}
	
	int nm_ans=0,max_ans=0;
	
	while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
		switch(size){
		case 1:
			for(int i=0;i<5;i++){
				if((min(x+vx[i],y+vy[i])>=0)&&max(x+vx[i],y+vy[i])<10){
					map[x+vx[i]][y+vy[i]]++;
				}
			}
			break;
		case 2:
			for(int i=0;i<9;i++){
				if((min(x+vx[i],y+vy[i])>=0)&&max(x+vx[i],y+vy[i])<10){
					map[x+vx[i]][y+vy[i]]++;
				}
			}
			break;
		case 3:
			for(int i=0;i<13;i++){
				if((min(x+vx[i],y+vy[i])>=0)&&max(x+vx[i],y+vy[i])<10){
					map[x+vx[i]][y+vy[i]]++;
				}
			}
			break;
		}
	}
	
	
	
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			if(map[i][j]>max_ans){
				max_ans=map[i][j];
			}
			if(map[i][j]==0){
				nm_ans++;
			}
		}
	}
	cout<<nm_ans<<endl;
	cout<<max_ans<<endl;
	return 0;
}