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<stdio.h>

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

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

using namespace std;

short inkmap[10][10] = { 0 };

void drawSmall(int, int);
void drawMedium(int, int);
void drawLarge(int, int);
void sch(short *, short *);

int main(void) {
	short mx = 0, buff[3], c = 0;
	
	while( scanf("%d,%d,%d", &buff[0], &buff[1], &buff[2]) != EOF ) {
		switch(buff[2]) {
		case 1:
			drawSmall(buff[0], buff[1]);		break;
		case 2:
			drawMedium(buff[0], buff[1]);		break;
		case 3:
			drawLarge(buff[0], buff[1]);		break;
		}
	}
	sch(&c, &mx);
	cout << c << endl << mx << endl;
}

void drawSmall(int x, int y) {
	const short vX[5] = { 0, -1, 0, 1, 0 };
	const short vY[5] = { -1, 0, 0, 0, 1 };
	int nX, nY;
	for(int i = 0; i < 5; i++) {
		nX = x + vX[i], nY = y + vY[i];
		if( ( 0 <= nX && nX < 10 ) && ( 0 <= nY && nY < 10 ) )
		inkmap[nX][nY]++;
	}
}
void drawMedium(int x, int y) {
	const short vX[9] = { -1, 0, 1, -1, 0, 1, -1, 0, 1 };
	const short vY[9] = { -1, -1, -1, 0, 0, 0, 1, 1, 1 };
	int nX, nY;
	for(int i = 0; i < 9; i++) {
		nX = x + vX[i], nY = y + vY[i];
		if( ( 0 <= nX && nX < 10 ) && ( 0 <= nY && nY < 10 ) )
		inkmap[nX][nY]++;
	}
}
void drawLarge(int x, int y) {
	const short vX[13] = { 0, -1, 0, 1, -2, -1, 0, 1, 2, -1, 0, 1, 0 };
	const short vY[13] = { -2, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1, 2 };
	int nX, nY;
	for(int i = 0; i < 13; i++) {
		nX = x + vX[i], nY = y + vY[i];
		if( ( 0 <= nX && nX < 10 ) && ( 0 <= nY && nY < 10 ) )
		inkmap[nX][nY]++;
	}
}
void sch(short *c, short *m) {
	for(int i = 0; i < 10; i++) {
		for(int j = 0; j < 10; j++) {
			if(inkmap[i][j] == 0) {
				(*c)++;
			}
			else {
				*m = max(*m, inkmap[i][j]);
			}
		}
	}
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cstring>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)

long long paper[10][10];
const int dx[] = {0,0,1,-1};
const int dy[] = {1,-1,0,0};
const int diax[] = {1,1,-1,-1};
const int diay[] = {-1,1,1,-1};


void filldd(int x, int y){
	rep(k,4){
		int tx = x+dx[k] , ty = y+dy[k];
		if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
		paper[ty][tx]++;
	}
}
void filldia(int x, int y){
	rep(k,4){
		int tx = x+diax[k] , ty = y+diay[k];
		if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
		paper[ty][tx]++;
	}
}

void dai(int x, int y){
	REP(z,1,3)rep(k,4){
		int tx = x+dx[k]*z , ty = y+dy[k]*z;
		if( tx<0 || ty<0 || tx>=10 || ty>=10 )continue;
		paper[ty][tx]++;
	}
	filldia(x,y);
}
void chuu(int x, int y){
	filldd(x,y);
	filldia(x,y);
}

int main(){
	int x,y,sz;
	memset(paper,0,sizeof(paper));
	while(~scanf("%d,%d,%d",&x,&y,&sz)){
		paper[y][x]++;
		if( sz==3 )      dai(x,y);
		else if( sz==2 ) chuu(x,y);
		else             filldd(x,y);
	}
	long long nasi = 0, ari = 0;
	rep(i,10)rep(j,10){
		if( paper[i][j]==0 )nasi++;
		else{
			ari = max(ari,paper[i][j]);
		}
	}
	printf("%lld\n%lld\n",nasi,ari);
	return 0;
}