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 <cstdio>
using namespace std;

int map[10][10];
int dx[] = {0, -1, 0, 1}, dy[] = {1, 0, -1, 0};

int main(void){
  int x, y, size;
  while(scanf("%d,%d,%d", &x, &y, &size) != EOF){
    if(size == 1){
      map[x][y]++;
      for(int i = 0; i < 4; i++){
        int nx = x + dx[i], ny = y + dy[i];
        if(0 <= nx && nx < 10 && 0 <= ny && ny < 10) map[nx][ny]++;
      }
    }else if(size == 2){
      for(int i = -1 ; i <= 1; i++) for(int j = -1; j <= 1; j++){
        int nx = x + i, ny = y + j;
        if(0 <= nx && nx < 10 && 0 <= ny && ny < 10) map[nx][ny]++;
      }
    }else if(size == 3){
      for(int i = -1 ; i <= 1; i++) for(int j = -1; j <= 1; j++){
        int nx = x + i, ny = y + j;
        if(0 <= nx && nx < 10 && 0 <= ny && ny < 10) map[nx][ny]++;
      }
      if(y + 2 < 10) map[x][y + 2]++;
      if(0 <= y - 2) map[x][y - 2]++;
      if(x + 2 < 10) map[x + 2][y]++;
      if(0 <= x - 2) map[x - 2][y]++;
    }
  }  
  int cnt = 0, maxCard = 0;
  for(int i = 0; i < 10; i++) for(int j = 0; j < 10; j++){
    if(map[i][j] == 0) cnt++;
    if(map[i][j] > maxCard) maxCard = map[i][j]++;
  }
  
  cout << cnt << endl << maxCard << endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int x,y,size,maxm,cnt;
int t[10][10];
char ch;
void pl(int y,int x){
  if(y<0||y==10||x<0||x==10)return;
  t[y][x]++;
  maxm=max(maxm,t[y][x]);
}

int main(){
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      t[i][j]=0;
  maxm=cnt=0;
  while(cin>>x>>ch>>y>>ch>>size){
    if(size==1){
      pl(y,x),pl(y+1,x),pl(y-1,x),pl(y,x+1),pl(y,x-1);
    }else if(size==2){
      for(int i=y-1;i<y+2;i++){
	for(int j=x-1;j<x+2;j++){
	  pl(i,j);
	}
      }
    }else{
      for(int i=y-2;i<y+3;i++){
	for(int j=x-2;j<x+3;j++){
	  if((i-y)*(i-y)+(j-x)*(j-x)<=4)pl(i,j);
	}
      }
    }
  }
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      if(t[i][j]==0)cnt++;
  cout<<cnt<<endl<<maxm<<endl;
  return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	int bigx[4] = { 0, 2, 0, -2 };
	int bigy[4] = { 2, 0, -2, 0 };
	int smx[4] = {0,1,0,-1};
	int smy[4] = {1,0,-1,0};
	int midx[9] = { -1, -1, 0, 1, 1,  1,  0, -1 };
	int midy[9] = {  0,  1, 1, 1, 0, -1, -1, -1 };
	int map[10][10] = { 0 };
	int cnt = 100;
	int x, y, size;
	char s, d;
	int ma = 0;
	int c = 0;
	while (cin >> x >> s >> y >> d >> size){
		
		if (size == 1){
			for (int i = 0; i < 4; i++){
				int xx = smx[i] + x;
				int yy = smy[i] + y;
				if (xx >= 0 && xx < 10 && y >= 0 && y < 10){
					map[xx][yy]++;
				}
			}
		}
		else if (size == 2){
			for (int i = 0; i < 8; i++){
				int xx = midx[i] + x;
				int yy = midy[i] + y;
				if (xx >= 0 && xx < 10 && y >= 0 && y < 10){
					map[xx][yy]++;
				}
			}
		}
		else {
			for (int i = 0; i < 4; i++){
				int xx = bigx[i] + x;
				int yy = bigy[i] + y;
				if (xx >= 0 && xx < 10 && y >= 0 && y < 10){
					map[xx][yy]++;
				}
			}
			for (int i = 0; i < 8; i++){
				int xx = midx[i] + x;
				int yy = midy[i] + y;
				if (xx >= 0 && xx < 10 && y >= 0 && y < 10){
					map[xx][yy]++;
				}
			}
		}
	}
	/*for (int i = 0; i < 10; i++){
		for (int i2 = 0; i2 < 10; i2++){
			cout << map[i][i2] << " ";
			if (map[i][i2] != 0){
				cnt--;
			}
			ma = max(ma, map[i][i2]);
		}cout << endl;
	}*/
	cout << ma << endl;
	cout << cnt << endl;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int data[15][15]={0};
int main(){
	
	int x,y,s;
	char c;
	while(scanf("%d,%d,%d",&x,&y,&s)!=EOF){
		
		while(1){
			data[x][y]++;
			if(y-1>=0)data[x][y-1]++;
			if(x+1<10)data[x+1][y]++;
			if(y+1<10)data[x][y+1]++;
			if(x-1>=0)data[x-1][y]++;
			if(s==1)break;
			if(x+1<10 && y+1<10)data[x+1][y+1]++;
			if(x+1<10 && y-1>=0)data[x+1][y-1]++;
			if(x-1>=0 && y-1>=0)data[x-1][y-1]++;
			if(x-1>=0 && y+1<10)data[x-1][y+1]++;
			if(s==2)break;
			if(x+2<10)data[x+2][y]++;
			if(y-2>=0)data[x][y-2]++;
			if(y+2<10)data[x][y+2]++;
			if(x-2>=0)data[x-2][y]++;
			break;
		}
		
	}
	int white=0,ma=0;
	for(int i=0;i<10;i++){
		for(int j=0;j<10;j++){
			if(data[i][j]==0)white++;
			ma=max(ma,data[i][j]);
		}
	}
	
	cout<<white<<endl<<ma<<endl;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int paper[10][10];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int dx2[] = {1, 1, 1, 0, -1, -1, -1, 0};
int dy2[] = {1, 0, -1, -1, -1, 0, 1, 1};
void make_spot(int x, int y, int s){
	int nx, ny;
	if(s == 1){
		for(int i = 0; i < 4; i++){
			nx = x + dx[i], ny = y + dy[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}else if(s == 2){
		for(int i = 0; i < 8; i++){
			nx = x + dx2[i], ny = y + dy2[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}else if(s == 3){
		for(int i = 0; i < 8; i++){
			nx = x + dx2[i], ny = y + dy2[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
		for(int i = 0; i < 4; i++){
			nx = x + 2 * dx[i], ny = y + 2 * dy[i];
			if(nx < 0 || nx >= 10 || ny < 0 || ny >= 10) continue;
			paper[nx][ny]++;
		}
	}
	return ;
}
int main(){
	fill(paper[0], paper[10], 0);
	for(;;){
		int x, y, s;
		if(scanf("%d,%d,%d", &x, &y, &s) == EOF) break;
		make_spot(x, y, s);
	}
	int cnt = 0, max_density = 0;
	for(int i = 0; i < 10; i++){
		for(int j = 0; j < 10; j++){
			if(paper[i][j] == 0) cnt++;
			if(paper[i][j] > max_density) max_density = paper[i][j];
		}
	}
	cout << cnt << endl << max_density << endl;
	return 0;
}