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<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>
#include<cmath>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


#define X real()
#define Y imag()
typedef complex<double> P;

int main(){
	const int N = 10;
	int masu[N][N]={0};
	int a,b,c;
	while(scanf("%d,%d,%d",&a,&b,&c)!=EOF){
		string hit[4][5]={
			{"","","","",""},
			{
				"00000",
				"00100",
				"01110",
				"00100",
				"00000",
			},
			{
				"00000",
				"01110",
				"01110",
				"01110",
				"00000",
			},
			{
				"00100",
				"01110",
				"11111",
				"01110",
				"00100",
			},
		};
		
		a-=2;
		b-=2;
		
		rep(i,5){
			rep(j,5){
				int x = a+i;
				int y = b+j;
				if(x<0 || y<0 || x>=N || y>=N)continue;
				masu[y][x] += hit[c][i][j]-'0';
			}
		}
		
	}
	int z = 0;
	int p = 0;
	
	rep(i,N)rep(j,N){
		if(masu[i][j]==0)z++;
		p=max(p,masu[i][j]);
	}
	
	printf("%d\n%d\n",z,p);
	
}

C++: #include<iostream>
#include<stdio.h>

int paper[10][10];
int vecx[] = { 0, 1, 0, -1 }, vecy[] = { -1, 0, 1, 0 };

int main()
{
	int x, y, size;
	
	while( scanf( "%d,%d,%d", &x, &y, &size ) != EOF ){
		switch( size ){
			case 1:
				paper[x][y]++;
				for( int i = 0; i < 4; i++ ){
					int nx = x + vecx[i], ny = y + vecy[i];
					
					if( nx >= 0 && nx < 10 && y >= 0 && y < 10 ){
						paper[nx][ny]++;
					}
				}
				break;
			case 2:
			        for( int i = -1; i <= 1; i++ ){
					for( int j = -1; j <= 1; j++ ){
						if( x + i >= 0 && x + i < 10 && y + j >= 0 && y + j < 10 ){
							paper[x+i][y+j]++;
						}
					}
				}
				
				break;
			case 3:
				for( int i = -1; i <= 1; i++ ){
					for( int j = -1; j <= 1; j++ ){
						if( x + i >= 0 && x + i < 10 && y + j >= 0 && y + j < 10 ){
							paper[x+i][y+j]++;
						}
					}
				}
				
				for( int i = 0; i < 4; i++ ){
					int nx = x + vecx[i] * 2, ny = y + vecy[i] * 2;
					
					if( nx >= 0 && nx < 10 && y >= 0 && y < 10 ){
						paper[nx][ny]++;
					}
				}
				break;
		}
	}
	
	int a = 0, b = 0;
	
	for( int i = 0; i < 10; i++ ){
		for( int j = 0; j < 10; j++ ){
			if( !paper[i][j] ){
				a++;
			}
			else{
			 	b = std::max( b, paper[i][j] );
			}
		}
	}
	
	std::cout << a << std::endl;
	std::cout << b << std::endl;

 	return 0;
}

C++: #include <cstdio>
#include <algorithm>

void ink(int,int,int);
void change(int,int,int);

char paper[10][10]={0};

int main(void){
	int white=0,max_ink=0;

	for(int x,y,size;scanf("%d,%d,%d",&x,&y,&size)!=EOF;)
		ink(x,y,size);

	for(int i=0;i<10;i++)
		for(int j=0;j<10;j++)
			if(!paper[i][j])
				white++;
			else
				max_ink=std::max(max_ink,int(paper[i][j]));

	printf("%d\n%d\n",white,max_ink);
	return 0;
}

void ink(int x,int y,int size){
	switch(size){
		case 1:
			ink(x,y,2);
			for(int i=-1;i<=1;i+=2)
				for(int j=-1;j<=1;j+=2)
					change(x+i,y+j,-1);
			break;
		case 2:
			for(int i=-1;i<=1;i++)
				for(int j=-1;j<=1;j++)
					change(x+i,y+j,1);
			break;
		case 3:
			ink(x,y,2);
			change(x-2,y,1);
			change(x+2,y,1);
			change(x,y-2,1);
			change(x,y+2,1);
			break;
	}
}

void change(int x,int y,int inc){
	if(x>=0&&x<10&&y>=0&&y<10)
		paper[x][y]+=inc;
}

C++: #include<iostream>
#include<string>
#include<stdlib.h>
using namespace std;
bool in(int x,int y){
  if(x<0||x>9||y<0||y>9) return false;
  return true;
}
int main(){
  int pa[10][10]={{}};
  string str;
  int i,j;
  while(cin >> str){
    int x=str[0]-'0',y=str[2]-'0',s=str[4]-'0';
    if(s==1){
      for(i=-1;i<=1;i++){
	for(j=-1+abs(i);j<=1-abs(i);j++){
	  if(in(x+i,y+j)) pa[x+i][y+j]++;
	}
      }
    }else if(s==2){
      for(i=-1;i<=1;i++){
	for(j=-1;j<=1;j++){
	  if(in(x+i,y+j)) pa[x+i][y+j]++;
	}
      }
    }else if(s==3){
      for(i=-2;i<=2;i++){
	for(j=-2+abs(i);j<=2-abs(i);j++){
	  if(in(x+i,y+j)) pa[x+i][y+j]++;
	}
      }
    }
  }
  int o=0,m=0;
  for(i=0;i<10;i++){
    for(j=0;j<10;j++){
      //cout << pa[i][j];
      m=max(m,pa[i][j]);
      if(pa[i][j]==0) o++;
    }
    //cout << endl;
  }
  cout << o << endl << m << endl;
  return 0;
}

C++: #include<stdio.h>

int main(void)
{
	int i,j,k,paper[10][10]={0},x,y,n,c=0,max=0;
	
	while(scanf("%d",&x)!=EOF){
		scanf(",%d,%d",&y,&n);
		
		if(n==0)break;
		
		if(n==1){
			if(y-1>=0)paper[y-1][x]++;
			if(y+1<10)paper[y+1][x]++;
			if(x-1>=0)paper[y][x-1]++;
			if(x+1<10)paper[y][x+1]++;
			if(y>=0 && y<10 && x>=0 && x<10)paper[y][x]++;
		}
		if(n==2){
			if(y-1>=0)paper[y-1][x]++;
			if(y+1<10)paper[y+1][x]++;
			if(x-1>=0)paper[y][x-1]++;
			if(x+1<10)paper[y][x+1]++;
			if(y-1>=0 && x-1>=0)paper[y-1][x-1]++;
			if(y-1>=0 && x+1<10)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]++;
			if(y>=0 && y<10 && x>=0 && x<10)paper[y][x]++;
		}
		if(n==3){
			if(y-1>=0)paper[y-1][x]++;
			if(y+1<10)paper[y+1][x]++;
			if(x-1>=0)paper[y][x-1]++;
			if(x+1<10)paper[y][x+1]++;
			if(y-1>=0 && x-1>=0)paper[y-1][x-1]++;
			if(y-1>=0 && x+1<10)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]++;
			
			if(y-2>=0)paper[y-2][x]++;
			if(y+2<10)paper[y+2][x]++;
			if(x+2<10)paper[y][x+2]++;
			if(x-2>=0)paper[y][x-2]++;
			if(y>=0 && y<10 && x>=0 && x<10)paper[y][x]++;
		}
	}
	
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			if(paper[i][j]==0)c++;
			if(paper[i][j]>=max)max=paper[i][j];
		}
	}
	printf("%d\n%d\n",c,max);
	return 0;
}