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 <stdio.h>
#include <iostream>
#include <string>
using namespace std;

int input(string, int);

int main() {
	string in;
	int a[10][10] = {};
	int x, y, s, n = 0, max;
	while (cin >> in) {
		x = input(in, 0);
		y = input(in, 1);
		s = input(in, 2);
		switch (s){
		case 3:
			if (x >= 2)
				a[x - 2][y]++;
			if (x <= 7)
				a[x + 2][y]++;
			if (y >= 2)
				a[x][y-2]++;
			if (y <= 7)
				a[x][y+2]++;
		case 2:
			if (x >= 1 && y >= 1)
				a[x - 1][y - 1]++;
			if (x >= 1 && y <= 8)
				a[x - 1][y + 1]++;
			if (x <= 8 && y >= 1)
				a[x + 1][y - 1]++;
			if (x <= 8 && y <= 8)
				a[x + 1][y + 1]++;
		}
		if (x >= 1)
			a[x - 1][y]++;
		if (x <= 8)
			a[x + 1][y]++;
		if (y >= 1)
			a[x][y - 1]++;
		if (x <= 8)
			a[x][y+1]++;
		a[x][y]++;
	}
	max = a[0][0];
	for (int i = 0; i < 100; i++) {
		if (a[i / 10][i % 10] == 0)
			n++;
		if (max < a[i / 10][i % 10])
			max = a[i / 10][i % 10];
	}
	cout << n << endl << max << endl;
	return 0;
}

/*
int main() {
	string in;
	int i;
	while (1) {
		cin >> in;
		cin >> i;
		cout<<input(in, i)<<endl;
	}
}
*/
int input(string in, int n) {
	int x = 0;
	for (int i = 0;; i++) {
		if (in[i] == ',' && n > 0) {
			n--;
			continue;
		}
		if (n > 0)
			continue;
		if (in[i] == ','|| in[i] == '\0')
			return x;
		x *= 10;
		x += in[i] - '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),cin){
		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;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(void){
	int box[11][11];
	int i,j;
	int x,y,z;
	int sx[4]={ 0,-1, 1, 0};
	int sy[4]={-1, 0, 0, 1};
	int mx[8]={-1, 0, 1,-1, 1,-1, 0, 1};
	int my[8]={-1,-1,-1, 0, 0, 1, 1, 1};
	int lx[12]={ 0,-1, 0, 1,-2,-1, 1, 2,-1, 0, 1, 0};
	int ly[12]={-2,-1,-1,-1, 0, 0, 0, 0, 1, 1, 1, 2};
	int xx,yy;
	int sum,MAX;
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			box[i][j]=0;
		}
	}
	while(scanf("%d",&x)!=EOF){
		scanf(",%d,%d",&y,&z);
		if(0<=x&&x<10&&0<=y&&y<10)	box[y][x]++;
		if(z==1){
			for(i=0;i<4;i++){
				xx=x+sx[i];
				yy=y+sy[i];
				//cout<<xx<<" "<<yy<<endl;
				if(0<=xx&&xx<10&&0<=yy&&yy<10){
					box[yy][xx]++;
				}
			}
		}
		else if(z==2){
			for(i=0;i<8;i++){
				xx=x+mx[i];
				yy=y+my[i];
				//cout<<xx<<" "<<yy<<endl;
				if(0<=xx&&xx<10&&0<=yy&&yy<10){
					box[yy][xx]++;
				}
			}
		}
		else{
			for(i=0;i<12;i++){
				xx=x+lx[i];
				yy=y+ly[i];
				//cout<<xx<<" "<<yy<<endl;
				if(0<=xx&&xx<10&&0<=yy&&yy<10){
					box[yy][xx]++;
				}
			}
		}
	}
	sum=0;
	MAX=-1;
	for(i=0;i<10;i++){
		for(j=0;j<10;j++){
			if(box[i][j]>0)	MAX=max(MAX,box[i][j]);
			else			sum++;
		}
	}
	cout<<sum<<endl;
	cout<<MAX<<endl;
	return 0;
}

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

int paper[10][10] = { 0 };
int white = 100, max = 0;

void ink(int x, int y) {
	if (0 <= x && x <= 9 && 0 <= y && y <= 9) {
		if (paper[x][y] == 0) white--;
		paper[x][y] += 1;
		max = paper[x][y] > max ? paper[x][y] : max;
	}
}

int main() {
	int x, y, s;
	while (std::scanf("%d,%d,%d", &x, &y, &s) != EOF) {
		if (s >= 3) {
			ink(x - 2, y);
			ink(x + 2, y);
			ink(x, y - 2);
			ink(x, y + 2);
		}
		if (s >= 2) {
			ink(x - 1, y - 1);
			ink(x - 1, y + 1);
			ink(x + 1, y - 1);
			ink(x + 1, y + 1);
		}
		ink(x, y);
		ink(x - 1, y);
		ink(x + 1, y);
		ink(x, y - 1);
		ink(x, y + 1);
	}
	std::cout << white << std::endl << max << std::endl;
	return 0;
}