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
                }
        }
}

Python: import sys

lines = []
for line in sys.stdin:
    lines.append(line.strip().split(','))

field = [[0 for i in range(10)] for j in range(10)]

def drop(x, y, z):
    if z==1:
        for i in range(-1,2):
            for j in range(-1,2):
                if abs(i)+abs(j)<2 and 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1
    elif z==2:
        for i in range(-1,2):
            for j in range(-1,2):
                if 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1
    else:
        for i in range(-2,3):
            for j in range(-2,3):
                if abs(i)+abs(j)<3 and 0<=y+j<=10 and 0<=x+i<=10:
                    field[y+j][x+i] += 1



for line in lines:
    x,y,z = map(int, line)
    print(x,y,z)
    drop(x,y,z)

n = 0
m = 0
for f in field:
    for e in f:
        if e > m:
            m = e
        if e==0:
            n+=1

print(n)
print(m)

Python: paper = [[0 for i in range(10)] for j in range(10)]

def drop_ink(x, y, s):
    for i in range(-1, 2):
        for j in range(-1, 2):
            if s == 1 and i * j != 0:
                continue
            if 0 <= x + i < 10 and 0 <= y + j < 10:
                paper[x+i][y+j] += 1
    if s == 3:
        if x - 2 >= 0:
            paper[x-2][y] += 1
        if x + 2 < 10:
            paper[x+2][y] += 1
        if y - 2 >= 0:
            paper[x][y-2] += 1
        if y + 2 < 10:
            paper[x][y+2] += 1

while True:
    try:
        x, y, s = map(int, input().split(','))
        drop_ink(x, y, s)
    except:
        break

count = 0
max_density = 0
for i in range(10):
    for j in range(10):
        if paper[i][j] == 0:
            count += 1
        elif paper[i][j] > max_density:
            max_density = paper[i][j]
print(count)
print(max_density)

Python: peper=[[0 for i in range(14)]for j in range(14)]
while True:
    try:
        x,y,s=map(int,input().split(","))
        x +=2
        y +=2
        if s==3:
            peper[y][x] +=1
            peper[y][x-1] +=1
            peper[y][x-2] +=1
            peper[y][x+1] +=1
            peper[y][x+2] +=1
            peper[y-1][x] +=1
            peper[y-2][x] +=1
            peper[y+1][x] +=1
            peper[y+2][x] +=1
            peper[y-1][x-1] +=1
            peper[y-1][x+1] +=1
            peper[y+1][x-1] +=1
            peper[y+1][x+1] +=1
        elif s==2:
            peper[y][x] +=1
            peper[y][x+1] +=1
            peper[y][x-1] +=1
            peper[y+1][x] +=1
            peper[y+1][x+1] +=1
            peper[y+1][x-1] +=1
            peper[y-1][x] +=1
            peper[y-1][x+1] +=1
            peper[y-1][x-1] +=1
        elif s==1:
            peper[y][x] +=1
            peper[y+1][x] +=1
            peper[y-1][x] +=1
            peper[y][x+1] +=1
            peper[y][x-1] +=1
    except:
        co=0
        ma=0
        for i in range(2,12):
            for j in range(2,12):
                if peper[i][j]==0:
                    co +=1
                else:
                    ma=max(ma,peper[i][j])
        print(co)
        print(ma)
        break

Python: paper = {}
counter = 0
i = 0
for i in range(10):
	for j in range(10):
		paper.update({(i,j):0})
while i < 50:
	try:
		x, y, s = list(map(int,input().split(",")))
	except:
		break
	if s == 3:
		paper[(x+2,y)] += 1
		paper[(x-2,y)] += 1
		paper[(x,y+2)] += 1
		paper[(x,y-2)] += 1
	if s >= 2:
		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,y)] += 1
	paper[(x,y-1)] += 1
	paper[(x,y+1)] += 1
	paper[(x+1,y)] += 1
	paper[(x-1,y)] += 1
	i += 1

for i in range(10):
	for j in range(10):
		if paper[(i,j)] == 0:
			counter += 1
print(counter)
print(max(paper.values()))

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];
			if(mx>=0 && mx<10 && my>=0 && my<10){
				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 <cmath>
#include <vector>
#include <cstdio>
#include <algorithm>
using namespace std;
int main ()
{
	int m[18][18] = {};
	int x, y, s;
	int dx1[4] = {0, 1, 0, -1}, dy1[4] = {1, 0, -1, 0};
	int dx2[8] = {0, 1, 1, 1, 0, -1, -1, -1}, dy2[8] = {1, 1, 0, -1, -1, -1, 0, 1};
	int dx3[12] = {0, -1, 0, 1, -2, -1, 1, 2, -1, 0, 1, 0}, dy3[12] = {2, 1, 1, 1, 0, 0, 0, 0, -1, -1, -1, -2};
	while (scanf("%d,%d,%d", &x, &y, &s) != EOF)
	{
		x += 3;
		y += 3;
		m[x][y]++;
		switch (s)
		{
		case 1:
			for (int i = 0; i < 4; i++)m[x + dx1[i]][y + dy1[i]]++;
			break;
		case 2:B
			for (int i = 0; i < 8; i++)m[x + dx2[i]][y + dy2[i]]++;
			break;
		case 3:
			for (int i = 0; i < 12; i++)m[x + dx3[i]][y + dy3[i]]++;
			break;
		}
	}
	int ans1 = 0, ans2 = 0;
	for (int x = 3; x <13; x++)
	{
		for (int y = 3; y < 13; y++)
		{
			if (m[x][y] == 0)ans1++;
			ans2 = max(ans2, m[x][y]);
			cout<<m[y][x];
		}
		cout<<endl;
	}
	cout << ans1 << endl << ans2 << endl;
	return 0;
}