Go: package main

import (
        "fmt"
)

var paper [10][10]int

func main() {
        var x, y, s int
        for {
                _, err := fmt.Scanf("%d,%d,%d", &x, &y, &s)
                if err != nil {
                        break
                }

                fill(x, y, s)
        }
        var d, z int
        for i := 0; i < 10; i++ {
                for j := 0; j < 10; j++ {
                        if paper[i][j] == 0 {
                                z += 1
                        }
                        if paper[i][j] > d {
                                d += 1
                        }
                }
        }
        fmt.Printf("%d\n%d\n", z, d)
}

func fill(x int, y int, s int) {
        paper[x][y] += 1
        if x > 0 {
                paper[x-1][y] += 1
        }
        if x < 9 {
                paper[x+1][y] += 1
        }
        if y > 0 {
                paper[x][y-1] += 1
        }
        if y < 9 {
                paper[x][y+1] += 1
        }

        if s >= 2 {
                if x > 0 && y > 0 {
                        paper[x-1][y-1] += 1
                }
                if x > 0 && y < 9 {
                        paper[x-1][y+1] += 1
                }
                if x < 9 && y > 0 {
                        paper[x+1][y-1] += 1
                }
                if x < 9 && y < 9 {
                        paper[x+1][y+1] += 1
                }
        }

        if s > 2 {
                if x > 1 {
                        paper[x-2][y] += 1
                }
                if x < 8 {
                        paper[x+2][y] += 1
                }
                if y > 1 {
                        paper[x][y-2] += 1
                }
                if y < 8 {
                        paper[x][y+2] += 1
                }
        }
}

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

#define scanf scanf_s
#define SIZE 10

using namespace std;

int format[3][12][2] = { { { 0,1 },{ 1,0 },{ 0,-1 },{ -1,0 } },
						 { { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 } },
						 { { 0,1 },{ 1,1 },{ 1,0 },{ 1,-1 },{ 0,-1 },{ -1,-1 },{ -1,0 },{ -1,1 },{ 0,2 },{ 2,0 },{ 0,-2 },{ -2,0 } } };

int main() {
	int dx, dy, x, y, s, count, most, map[SIZE][SIZE], num[3] = { 4,9,12 };

	count = 100;
	most = 0;
	while (scanf("%d,%d,%d", &x, &y, &s)) {
		x--;
		y--;
		s--;

		for (int i = 0; i < num[s]; i++) {
			dx = x + format[s][i][0];
			dy = y + format[s][i][1];

			if (dx < 0 || dx >= SIZE || dy < 0 || dy >= SIZE) {
				continue;
			}

			map[dx][dy]++;
			if (map[dx][dy] == 1) {
				count--;
			}

			if (map[dx][dy] > most) {
				most = map[dx][dy];
			}
		}
	}

	cout << count << endl << most << endl;
	return 0;
}

C++: #include<iostream>
#include<cstdio>
using namespace std;
int main()
{
	int x,y,size;
	int paper[10][10] = { 0 };

	while(scanf("%d,%d,%d",&x,&y,&size) != EOF){
		switch (size){
			case 1 : 	paper[x][y] += 1;
							paper[x-1][y] += 1;
							paper[x+1][y] += 1;
							paper[x][y-1] += 1;
							paper[x][y+1] += 1;
							break;

			case 2 : 	paper[x][y] += 1;
							paper[x-1][y] += 1;
							paper[x+1][y] += 1;
							paper[x][y-1] += 1;
							paper[x][y+1] += 1;
							paper[x-1][y-1] += 1;
							paper[x-1][y+1] += 1;
							paper[x+1][y-1] += 1;
							paper[x+1][y+1] += 1;
							break;

			case 3 : 	paper[x][y] += 1;
							paper[x-1][y] += 1;
							paper[x+1][y] += 1;
							paper[x][y-1] += 1;
							paper[x][y+1] += 1;
							paper[x-1][y-1] += 1;
							paper[x-1][y+1] += 1;
							paper[x+1][y-1] += 1;
							paper[x+1][y+1] += 1;
							paper[x-2][y] += 1;
							paper[x+2][y] += 1;
							paper[x][y-2] += 1;
							paper[x][y+2] += 1;
							break;
		}
	}
	int zcount = 0;
	int density = 0;

	for(int i = 0;i < 10;i++){
		for(int j = 0;j < 10;j++){
			if(paper[i][j] == 0){
				zcount++;
			}
			if(density < paper[i][j]){
				density = paper[i][j];
			}
		}
	}

	cout << zcount << endl << density << endl;
}

C++: #include <stdio.h>

int main(){
	int map[10][10],ink,x,y,max=0,count=0;
	int dx[] = { 0, 0,-1, 1,-1,-1, 1, 1, 0, 0,-2, 2};
	int dy[] = {-1, 1, 0, 0,-1, 1,-1, 1,-2, 2, 0, 0};

	for(int i=0 ; i<10 ; i++){
		for(int j=0 ; j<10 ; j++){
			map[i][j] = 0;
		}
	}
	while( scanf("%d,%d,%d", &x, &y, &ink) != EOF ){
		map[y][x]++;
		for(int i=0 ; i<ink*4 ; i++){
			int mx = x + dx[i];
			int my = y + dy[i];
			map[my][mx]++;
		}
	}
	for(int y=0 ; y<10 ; y++){
		for(int x=0 ; x<10 ; x++){
			if(map[y][x]==0){
				count++;
			}
			if(map[y][x]>max){
				max = map[y][x];
			}
		}
	}
	printf("%d\n%d\n", count , max);
}

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

using namespace std;

int p[10][10];

void F (int x, int y) {
    if (0 <= x && x < 10 && 0 <= y && y < 10) {
        p[x][y]++;
    }
}

int main (void) {
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            p[i][j] = 0;
        }
    }
    while (1) {
        int x, y, s;
        if (scanf("%d,%d,%d", &x, &y, &s) == EOF) break;
        if (cin.eof()) break;
        p[x][y]++;
        if (s == 1) {
            F(x + 1, y    );
            F(x - 1, y    );
            F(x    , y + 1);
            F(x    , y - 1);
        } else if (s == 2) {
            F(x + 1, y + 1);
            F(x + 1, y    );
            F(x + 1, y - 1);
            F(x    , y + 1);
            F(x    , y - 1);
            F(x - 1, y + 1);
            F(x - 1, y    );
            F(x - 1, y - 1);
        } else {
            F(x + 1, y + 1);
            F(x + 1, y    );
            F(x + 1, y - 1);
            F(x    , y + 1);
            F(x    , y - 1);
            F(x - 1, y + 1);
            F(x - 1, y    );
            F(x - 1, y - 1);
            F(x + 2, y    );
            F(x - 2, y    );
            F(x    , y + 2);
            F(x    , y - 2);
        }
    }
    int e = 0, m = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (p[i][j] == 0) e++;
            m = max(m, p[i][j]);
        }
    }
    cout << e << endl;
    cout << m << endl;
    return 0;
}

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

typedef struct {
	int x, y;
}P;
vector<P> vs = {
	{0, -1}, { -1,0 }, { 0,0 }, { 0,1 }, { 1,0 }
};
vector<P> vm = {
	{-1,-1},{-1,0},{-1,1},{0,-1},{0,0},{0,1},{1,-1},{1,0},{1,1}
};
vector<P> vl = {
	{-2,0},{-1,-1},{-1,0},{-1,1},{0,-2},{0,-1},{0,0},{0,1},{0,2},{1,-1},{1,0},{1,1},{2,0}
};

bool ok(P p1, P p2) {
	int x = p1.x + p2.y;
	int y = p1.y + p2.y;
	return x >= 0 && x < 10 && y >= 0 && y < 10;
}

int s, p[10][10] = { 0 };
P c;

int main(){
	while (scanf("%d,%d,%d",&c.x, &c.y, &s) != EOF) {
		vector<P>::iterator itr = s == 1 ? vs.begin() : s == 2 ? vm.begin() : vl.begin();
		vector<P>::iterator e = s == 1 ? vs.end() : s == 2 ? vm.end() : vl.end();
		while (itr != e) {
			if (ok(c, *itr)) {
				p[c.x + itr->x][c.y + itr->y]++;
			}
			itr++;
		}
	}
	int sum = 0, b = 0;
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			if (p[i][j] > 0) {
				sum++;
				if (p[i][j] > b) {
					b = p[i][j];
				}
			}
		}
	}
	printf("%d\n%d\n", sum, b);

	return 0;
}