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>
using namespace std;
int main(){
  int k[10][10]={0};
  int x,y,s,i,j;
  char c;
  int d=0,w=0;
  int S[4]={0,4,8,12};
  int X[]={1,-1,0,0,1,-1,1,-1,2,-2,0,0};
  int Y[]={0,0,1,-1,1,-1,-1,1,0,0,2,-2};
  while(cin>>x>>c>>y>>c>>s){
    k[x][y]++;
    for(i=0;i<S[s];i++){
      k[x+X[i]][y+Y[i]]++;
      if(k[x+X[i]][y+Y[i]]>d){
	d=k[x+X[i]][y+Y[i]];
      }
    }
  }
  for(i=0;i<10;i++){
    for(j=0;j<10;j++){
      if(k[i][j]==0)w++;
    }
  }
  if(d!=0){
    cout<<w<<"\n"<<d<<endl;
  }
  return 0;
}

C++: #include<iostream>
#include<string.h>
using namespace std;
int main()
{
    int ma[10][10];
    int x,y,d;
    char c;
    memset(ma,0,sizeof(ma));
    while(cin>>x>>c>>y>>c>>d){
//    for(int i=0;i<6;i++){
//        
//        cin>>x>>c>>y>>c>>d;
    
        ma[y][x]++;
        if(d==1){
            if(x>0){
                ma[y][x-1]++;
            }
            if(x<9){
                ma[y][x+1]++;
            }
            if(y>0){
                ma[y-1][x]++;
            }
            if(y<9){
                ma[y+1][x]++;
            }
        }
        else if(d==2){
            if(x>0){
                ma[y][x-1]++;
            }
            if(x<9){
                ma[y][x+1]++;
            }
            if(y>0){
                ma[y-1][x]++;
            }
            if(y<9){
                ma[y+1][x]++;
            }
            if(x>0&&y<9){
                ma[y+1][x-1]++;
            }
            if(x<9&&y>0){
                ma[y-1][x+1]++;
            }
            if(x>0&&y>0){
                ma[y-1][x-1]++;
            }
            if(x<9&&y<9){
                ma[y+1][x+1]++;
            }
        }
        else{
            if(x>0){
                ma[y][x-1]++;
            }
            if(x<9){
                ma[y][x+1]++;
            }
            if(y>0){
                ma[y-1][x]++;
            }
            if(y<9){
                ma[y+1][x]++;
            }
            if(x>0&&y<9){
                ma[y+1][x-1]++;
            }
            if(x<9&&y>0){
                ma[y-1][x+1]++;
            }
            if(x>0&&y>0){
                ma[y-1][x-1]++;
            }
            if(x<9&&y<9){
                ma[y+1][x+1]++;
            }
            if(x>1){
                ma[y][x-2]++;
            }
            if(x<8){
                ma[y][x+2]++;
            }
            if(y>1){
                ma[y-2][x]++;
            }
            if(y<8){
                ma[y+2][x]++;
            }
        }
    }
    int em=0,m=0;
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(ma[i][j]==0)em++;
            m=max(m,ma[i][j]);
        }
    }
    cout<<em<<endl<<m<<endl;
    return 0;
}

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

void base(int (*paper)[10],int x, int y) {
    if (x - 1 >= 0) {
		paper[y][x - 1]++;
	}
	if (x + 1 < 10) {
		paper[y][x + 1]++;
	}
	if (y - 1 >= 0) {
		paper[y - 1][x]++;
	}
	if (y + 1 < 10) {
		paper[y + 1][x]++;
	}
}

void sqare(int(*paper)[10], int x, int y) {
	if (x - 1 >= 0 && y - 1 >= 0) {
		paper[y - 1][x - 1]++;
	}
	if (x + 1 < 10 && y - 1 >= 0) {
		paper[y - 1][x + 1]++;
	}
	if (y + 1 < 10 && x - 1 >= 0) {
		paper[y + 1][x - 1]++;
	}
	if (y + 1 < 10 && x + 1 < 10) {
		paper[y + 1][x + 1]++;
	}
}

void slant(int(*paper)[10], int x, int y) {
	if (x - 2 >= 0) {
		paper[y][x - 2]++;
	}
	if (x + 2 < 10) {
		paper[y][x + 2]++;
	}
	if (y - 2 >= 0) {
		paper[y - 2][x]++;
	}
	if (y + 2 < 10) {
		paper[y + 2][x]++;
	}
}

int main()
{
	int paper[10][10] = {0};
	int x, y, s;
	char t;
	
	while (cin >> x >> t >> y >> t>> s) {
		paper[y][x]++;
		switch (s) 
		{
		    case 3:slant(paper,x, y);
		    case 2:sqare(paper,x, y);
		    case 1:base(paper,x, y);
		}
	}
	
	int sum = 0,max = 0;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (paper[i][j] > max) {
				max = paper[i][j];
			}
			if (paper[i][j] == 0) {
				sum++;
			}
		}
	}
	cout << sum << endl << max << endl;

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