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<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 
 using namespace std;
 
 double abs(double x)
 {
   if(x<0) return -x;
   else return x;       
 }
 
 bool judge(int x,int y)
 {
   if(x>=0&&x<10&&y>=0&&y<10) return true;
   else return false;     
 }
  
 int main()
 {
   int map[10][10]={{0}};
   int x,y,s;
   int dep=0;
   int blank=0;
   char temp;
   while(cin>>x>>temp>>y>>temp>>s)
   {
     if(s==1)
     {
       if(judge(x-1,y)) map[x-1][y]++;
       if(judge(x+1,y)) map[x+1][y]++;
       if(judge(x,y+1)) map[x][y+1]++;
       if(judge(x,y-1)) map[x][y-1]++;
       if(judge(x,y)) map[x][y]++;        
     }                   
     else if(s==2)
     {
       for(int i=-1;i<=1;i++)
       {
         for(int j=-1;j<=1;j++)
         {
           if(judge(x+i,y+j)) map[x+i][y+j]++;       
         }        
       }     
     }
     else
     {
       for(int i=-1;i<=1;i++)
       {
         for(int j=-1;j<=1;j++)
         {
           if(judge(x+i,y+j)) map[x+i][y+j]++;       
         }        
       }   
       if(judge(x-2,y)) map[x-2][y]++;
       if(judge(x+2,y)) map[x+2][y]++;
       if(judge(x,y+2)) map[x][y+2]++;
       if(judge(x,y-2)) map[x][y-2]++;    
     }
   }
   for(int i=0;i<10;i++)
   {
     for(int j=0;j<10;j++)
     {
       if(!map[i][j]) blank++;
       if(map[i][j]>dep) dep=map[i][j];        
     }        
   }
   cout<<blank<<dep<<endl;
   //while(1);      
   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) {
      density[y][x]++;
      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);
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main(){
  string str;
  int paper[10][10];
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      paper[i][j]=0;
    }
  }
  int I=50;
  while(cin >> str){
    int x,y,s;
    x=str[0]-48;
    y=str[2]-48;
    s=str[4]-48;
    if(s==1){
      paper[x][y]++;
      paper[x+1][y]++;
      paper[x-1][y]++;
      paper[x][y+1]++;
      paper[x][y-1]++;
    }
    else if(s==2){
      paper[x][y]++;
      paper[x][y+1]++;
      paper[x][y-1]++;
      paper[x+1][y]++;
      paper[x+1][y+1]++;
      paper[x+1][y-1]++;
      paper[x-1][y]++;
      paper[x-1][y+1]++;
      paper[x-1][y-1]++;
    }
    else if(s==3){
      paper[x][y-2]++;
      paper[x+1][y-1]++;
      paper[x][y-1]++;
      paper[x-1][y-1]++;
      paper[x-2][y]++;
      paper[x-1][y]++;
      paper[x][y]++;
      paper[x+1][y]++;
      paper[x+2][y]++;
      paper[x-1][y+1]++;
      paper[x][y+1]++;
      paper[x+1][y+1]++;
      paper[x][y+2]++;
    }
    int white=0,koii=0;
    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
        if(paper[i][j]==0)white++;
        koii=max(koii,paper[i][j]);
      }
    }
    cout << white << endl << koii << endl;
  }
}

C++: #include <iostream>
#include <cstdio>
using namespace std;
int mp[21][21];
void drop(int x,int y,int size){
  if(size==1)mp[y][x]++,mp[y+1][x]++,mp[y-1][x]++,mp[y][x+1]++,mp[y][x-1]++;
  if(size==2 || size==3)
    for(int i=-1;i<=1;i++)
      for(int j=-1;j<=1;j++) mp[y+i][x+j]++;
  if(size==3) mp[y+2][x]++,mp[y-2][x]++,mp[y][x+2]++,mp[y][x-2]++;
}
int main() {
  int x,y,size;
  while(scanf("%d,%d,%d",&x,&y,&size) != EOF) drop(x+10,y+10,size);
  int cnt=100,mxsize=0;
  for(int i=10;i<20;i++)
    for(int j=10;j<20;j++)
      if(mp[i][j] != 0)cnt--,mxsize=max(mxsize,mp[i][j]);
  cout << cnt <<endl<<mxsize<<endl;
  return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,l,n) for(int i=l;i<n;i++)
using namespace std;

int main(){
	int m[20][20]={},x,y,s,X,Y,max=0,ans=0;
	char c;
	while(cin>>x){
		cin>>c>>y>>c>>s;
		X=x+2; Y=y+2;
		m[X][Y]++; m[X+1][Y]++; m[X-1][Y]++;
		m[X][Y-1]++; m[X][Y+1]++;
		if(s==2||s==3){
			m[X-1][Y-1]++; m[X-1][Y+1]++;
			m[X+1][Y-1]++; m[X+1][Y+1]++;
		}
		if(s==3){
			m[X][Y-2]++; m[X][Y+2]++;
			m[X-2][Y]++; m[X+2][Y]++;
		}
	}
	rep(i,2,12){
		rep(j,2,12){
			if(m[i][j]==0) ans++;
			if(m[i][j]>max) max=m[i][j];
		}
	}
	cout<<ans<<endl<<max<<endl;
}