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>
#include<algorithm>

using namespace std;

int main(){
	int masu[10][10] = {0};
	int x, y, s, i, j, n = 0, cut = 0;
	int num[100] = {0};

	while(scanf("%d,%d,%d", &x, &y, &s) != EOF){
		masu[x][y] ++;
		if(s == 1){
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
		}
		else if(s == 2){
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
			masu[x-1][y-1] += 1, masu[x+1][y-1] += 1, masu[x-1][y+1] += 1, masu[x-1][y+1] += 1;
		}
		else{
			masu[x][y-1] += 1, masu[x][y+1] += 1, masu[x-1][y] += 1, masu[x+1][y] += 1;
			masu[x-1][y-1] += 1, masu[x+1][y-1] += 1, masu[x-1][y+1] += 1, masu[x-1][y+1] += 1;
			masu[x-2][y] += 1, masu[x+2][y] += 1, masu[x][y+2] += 1, masu[x][y-2] += 1;
		}
		
	}

	for(i = 0; i < 10; i ++){
		for(j = 0; j < 10; j ++){
			num[n] = masu[i][j];
			n ++;
		}
	}

	sort(num, num+100);

	for(i =0; i < 100; i ++){
		if(num[i] == 0) cut ++;
		else break;
	}

	cout << cut << endl << num[99] << endl;

	return 0;    
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<random>
using namespace std;

int main(){

  int s3x[12] = {0, 1, 0, -1, 1, 1, -1, -1, 0, 2, 0, -2};
  int s3y[12] = {1, 0, -1, 0, 1, -1, 1, -1, 2, 0, -2, 0};

  vector< vector<int> > p( 10, vector<int> (10, 0) );
  int x, y, s;
  int cnt = 0;
  int mx = 0;

  while( scanf("%d,%d,%d", &x, &y, &s) != EOF ){
    p[ x ][ y ]++;
    mx = max(mx, p[x][y]);
    cnt++;
    for(int i=0; i<s*4; i++){
      int tx = x + s3x[i];
      int ty = y + s3y[i];
      if( tx < 0 || ty < 0 || tx >= 10 || ty >= 10 ) continue;
      p[tx][ty]++;
      cnt++;
      mx = max(mx, p[tx][ty]);
    }
    // cerr << cnt << endl;
  }
  cout << cnt << endl;
  cout << mx << endl;
  return 0;
}




// EOF

C++: #include <stdio.h>

int x, y, q, r1, r2, ok[10][10];

int main()
{
	while (~scanf("%d,%d,%d", &x, &y, &q), x--, y--)
	{
		if (q == 1)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (-1 <= i + j && i + j <= 1)
					{
						if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
						{
							ok[y + i][x + j]++;
						}
					}
				}
			}
		}

		if (q == 2)
		{
			for (int i = -1; i <= 1; i++)
			{
				for (int j = -1; j <= 1; j++)
				{
					if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
					{
						ok[y + i][x + j]++;
					}
				}
			}
		}

		if (q == 3)
		{
			for (int i = -2; i <= 2; i++)
			{
				for (int j = -2; j <= 2; j++)
				{
					if (0 <= x + j && x + j < 10 && 0 <= y + i && y + i < 10)
					{
						ok[y + i][x + j]++;
					}
				}
			}
		}
	}

	for (int i = 0; i < 10; i++)
	{
		for (int j = 0; j < 10; j++)
		{
			if (ok[i][j] == 0)
			{
				r1++;
			}

			if (ok[i][j] > r2)
			{
				r2 = ok[i][j];
			}
		}
	}

	printf("%d\n", r1);
	printf("%d\n", r2);

	return 0;
}

C++: #include <iostream>
using namespace std;
int paper[10][10]={0};

int drop(int y, int x){
	if (0<=x && x<10 && 0<=y && y<10) paper[y][x]++;
	return 0;
}

int ink(int y, int x, int size){
	switch(size){
		case 3:
			drop(y-2, x); drop(y+2, x);
			drop(y, x-2); drop(y, x+2);
		case 2:
			drop(y-1, x-1); drop(y-1, x+1);
			drop(y+1, x-1); drop(y+1, x+1);
		case 1:
			drop(y, x);
			drop(y-1, x); drop(y+1, x);
			drop(y, x-1); drop(y, x+1);
	}
	return 0;
}

int main(void){
	
	while (true){
		int x,y,size;
		char c;
		cin>>x>>c>>y>>c>>size;
		if (cin.eof()) break;
		ink(y, x, size);
	}

	int n=10, c1=0, c2=0;
	for (int i=0; i<n; i++){
		for (int j=0; j<n; j++){
			int tmp = paper[j][i];
			if (tmp==0) c1++;
			if (tmp>c2) c2=tmp;
		}
	}
	cout<<c1<<endl;
	cout<<c2<<endl;
	return 0;
}

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

using namespace std;

void Solution()
{

    int ink[][2] = {{0,0}, {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}, {-2, 0}, {2, 0}, {0, 2}, {0, -2}}; // range from small size to big size
    
    int x;
    int y;
    int size;
    char comma;
    
    int a[10][10] = {{0}}; // the boundary, +1 for judging the spread of ink
    
    int count = 0;
    int density = 0;
    
    while (cin>>x>>comma>>y>>comma>>size)
    {
        for (int i = 0; i <= size * 4; i++)
        {
            if (x + ink[i][0] > 10 && x + ink[i][0] < 0 && y + ink[i][1] > 10 && y + ink[i][1] < 0)
            {
                continue;
            }
            else
            {
                a[x + ink[i][0]][y + ink[i][1]]++;
            }
        
        }
        
    }
    
    for (int i = 0; i < 10; i++)
    {
        for (int j = 0; j < 10; j++)
        {
            if(a[i][j] > 0)
            {
                count++;
            }
            
            if (a[i][j] > density)
            {
                density = a[i][j];
            }
        }
    }

    
    cout<<100 - count<<endl;
    cout<<density<<endl;

}

int main()
{
    Solution();
    return 0;
}