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

C++: #include<iostream>

using namespace std;


main(){
  
  int map[10][10];
  int x,y,size;
  //initialize
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      map[i][j]=0;
    }
  }
  int white=0,Max=0;
  while(scanf("%d,%d,%d",&x,&y,&size)!=EOF){
    
    if(size==1){
      if(y>=0&&y<10&&(x-1)>=0&&(x-1)<10)map[y][x-1]++;    
      if((y-1)>=0&&(y-1)<10&&x>=0&&x<10)map[y-1][x]++;
	 if(y>=0&&y<10&&x>=0&&x<10)map[y][x]++;
	    if((y+1)>=0 &&(y+1)<10&&x>=0&&x<10)map[y+1][x]++;
	       if(y>=0&&y<10&&(x+1)>=0&&(x+1)<10)map[y][x+1]++;
		  
    }
    if(size==2){
      
      if(y-1>=0&&y-1<10&&(x-1)>=0&&(x-1)<10)map[y-1][x-1]++;
      if(y+1>=0&&y+1<10&&(x-1)>=0&&(x-1)<10)map[y+1][x-1]++;
      
      if(y-1>=0&&y-1<10&&(x+1)>=0&&(x+1)<10)map[y-1][x+1]++;
      if(y+1>=0&&y+1<10&&(x+1)>=0&&(x+1)<10)map[y+1][x+1]++;
       if(y>=0&&y<10&&(x-1)>=0&&(x-1)<10)map[y][x-1]++;    
      if((y-1)>=0&&(y-1)<10&&x>=0&&x<10)map[y-1][x]++;
	 if(y>=0&&y<10&&x>=0&&x<10)map[y][x]++;
	    if((y+1)>=0 &&(y+1)<10&&x>=0&&x<10)map[y+1][x]++;
	       if(y>=0&&y<10&&(x+1)>=0&&(x+1)<10)map[y][x+1]++;


    }
    if(size==3){                     if(y>=0&&y<10&&(x-2)>=0&&(x-2)<10) map[y][x-2]++;
                     
       if(y-2>=0&&y-2<10&&(x)>=0&&(x)<10)map[y-2][x]++; if(y+2>=0&&y+2<10&&(x)>=0&&(x)<10)  map[y+2][x]++;
                      
                                     if(y>=0&&y<10&&(x+2)>=0&&(x+2)<10)  map[y][x+2]++;
					  if(y-1>=0&&y-1<10&&(x-1)>=0&&(x-1)<10)map[y-1][x-1]++;
      if(y+1>=0&&y+1<10&&(x-1)>=0&&(x-1)<10)map[y+1][x-1]++;
      
      if(y-1>=0&&y-1<10&&(x+1)>=0&&(x+1)<10)map[y-1][x+1]++;
      if(y+1>=0&&y+1<10&&(x+1)>=0&&(x+1)<10)map[y+1][x+1]++;
       if(y>=0&&y<10&&(x-1)>=0&&(x-1)<10)map[y][x-1]++;    
      if((y-1)>=0&&(y-1)<10&&x>=0&&x<10)map[y-1][x]++;
	 if(y>=0&&y<10&&x>=0&&x<10)map[y][x]++;
	    if((y+1)>=0 &&(y+1)<10&&x>=0&&x<10)map[y+1][x]++;
	       if(y>=0&&y<10&&(x+1)>=0&&(x+1)<10)map[y][x+1]++;
					
    }
    
    
  }

    for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	if(map[i][j]==0)white++;
	if(map[i][j]>=Max)Max=map[i][j];
      }
      
    }
  cout << white<<endl<< Max << endl;

  return 0;
}

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

//4方向ベクトル→↑←↓
const int px[4] ={1,0,-1,0};
const int py[4] ={0,-1,0,1};

int board[15][15];
int x,y,size;
int ans1,ans2;
int main()
{
  ans1 = 0;
  for(int i = 0;i <10;i++){
    for(int j = 0;j < 10;j++){
      board[i][j] = 0;
    }
  }
  while(scanf("%d,%d,%d",&x,&y,&size) !=EOF){
    if(x <0||y < 0||x >10 ||y >10){
      continue;
    }
    if(size ==1){
      board[y][x] +=1;
      for(int j = 0;j < 4;j++){
	int nx = x + px[j];
	int ny = y + py[j];
	if(nx <0 ||ny < 0||nx > 10||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++){
	 int nx = x +j;
	 int 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 <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
const int dx2[] = { -1, -1, 1, 1 }; const int dy2[] = { -1, 1, 1, -1 };
int main() {
	string s;
	int cell[10][10]={0};
	while (getline(cin, s)){
		if (s.empty())break;
		int x, y, size;
		x = s[0]-'0';
		y = s[2] - '0';
		size = s[4] - '0';
		switch (size)
		{
		case 3:
			REP(i, 4){
				if (0 <= x + dx[i] * 2 && x + dx[i] * 2 <= 9 && 0 <= y + dy[i] * 2 && y + dy[i] * 2 <= 9)
					cell[x + dx[i] * 2][y + dy[i] * 2]++;
			}
		case 2:
			REP(i, 4){
				if (0 <= x + dx2[i]  && x + dx2[i]  <= 9 && 0 <= y + dy2[i]  && y + dy2[i]  <= 9)
					cell[x + dx2[i] ][y + dy2[i]]++;
			}
		case 1:
			REP(i, 4){
				if (0 <= x + dx[i] && x + dx[i] <= 9 && 0 <= y + dy[i] && y + dy[i] <= 9)
					cell[x + dx[i]][y + dy[i]]++;
			}
			break;
		}
	}
	int maxb=0;
	int count=0;
	REP(i,10){
		REP(j,10){
			if(cell[i][j]==0)
			count++;
			maxb=max(maxb,cell[i][j]);
		}
	}
	cout<<count<<endl<<maxb<<endl;
}