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: def small_ink(paper,x,y):
  paper[x][y] += 1
  if 0 <= x-1 and x-1 < 10:
    paper[x-1][y] += 1
  if 0 <= y-1 and y-1 < 10:
    paper[x][y-1] += 1
  if 0 <= x+1 and x+1 < 10:
    paper[x+1][y] += 1
  if 0 <= y+1 and y+1 < 10:
    paper[x][y+1] += 1
  return paper

def middle_ink(paper,x,y):
  paper = small_ink(paper,x,y)
  if (0 <= x-1 and x-1 < 10) and (0 <= y-1 and y-1 < 10):
    paper[x-1][y-1] += 1
  if (0 <= x-1 and x-1 < 10) and (0 <= y+1 and y+1 < 10):
    paper[x-1][y+1] += 1
  if (0 <= x+1 and x+1 < 10) and (0 <= y-1 and y-1 < 10):
    paper[x+1][y-1] += 1
  if (0 <= x+1 and x+1 < 10) and (0 <= y+1 and y+1 < 10):
    paper[x+1][y+1] += 1
  return paper

def large_ink(paper,x,y):
  paper = middle_ink(paper,x,y)
  if (0 <= x-2 and x-2 < 10):
    paper[x-2][y] += 1
  if (0 <= y-2 and y-2 < 10):
    paper[x][y-2] += 1
  if (0 <= y+2 and y+2 < 10):
    paper[x][y+2] += 1
  if (0 <= x+2 and x+2 < 10):
    paper[x+2][y] += 1
  return paper

paper = [([0 for _ in range(10)]) for _ in range(10)]

while True:
  try:
    x,y,s = map(int, input().split(','))
  except EOFError:
    break
  if s == 1:
    paper = small_ink(paper,x,y)
  elif s == 2:
    paper = middle_ink(paper,x,y)
  elif s == 3:
    paper = large_ink(paper,x,y)

sum0 = 0
max_ink = 0
for i in range(10):
  for j in range(10):
    if paper[i][j] == 0:
      sum0 += 1
    if paper[i][j] > max_ink:
      max_ink = paper[i][j]
print(sum0)
print(max_ink)

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)
    drop(x,y,z)

Python: import sys
table = [[0 for j in range(10)] for i in range(10)]


def flag(x, y):
    if x > 9 or y > 9 or x < 0 or y < 0:
        return False
    else:
        return True


def small(x, y):
    table[x][y] += 1
    if flag(x+1, y):
        table[x+1][y] += 1
    if flag(x-1, y):
        table[x-1][y] += 1
    if flag(x, y+1):
        table[x][y+1] += 1
    if flag(x, y-1):
        table[x][y-1] += 1


def medium(x, y):
    small(x, y)
    if flag(x+1, y+1):
        table[x+1][y+1] += 1
    if flag(x+1, y-1):
        table[x+1][y-1] += 1
    if flag(x-1, y+1):
        table[x-1][y+1] += 1
    if flag(x-1, y-1):
        table[x-1][y-1] += 1


def large(x, y):
    medium(x, y)
    if flag(x+2, y):
        table[x+2][y] += 1
    if flag(x-2, y):
        table[x-2][y] += 1
    if flag(x, y+2):
        table[x][y+2] += 1
    if flag(x, y-2):
        table[x][y-2] += 1


def ink(x, y, s):
    if s == 1:
        small(x, y)
    if s == 2:
        medium(x, y)
    if s == 3:
        large(x, y)


def Search():
    counter = 0
    thickest = 0
    for i in range(10):
        for j in range(10):
            if table[i][j] == 0:
                counter += 1
            elif thickest < table[i][j]:
                thickest = table[i][j]
    print(counter)
    print(thickest)


for l in sys.stdin:
    data = list(map(int, l.split(",")))
    x, y, s = data
    ink(x, y, s)

Search()

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)
    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: # AOJ 0026 Dropping Ink
# Python3 2018.6.15 bal4u

paper = [[0 for i in range(15)] for j in range(15)]
base = 2

while True:
	try:
		x, y, s = list(map(int, input().split(',')))
	except EOFError:
		break
        
	x += 2
	y += 2
	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-1][y] += 1
	paper[x+1][y] += 1
	paper[x][y-1] += 1
	paper[x][y+1] += 1

cnt = max = 0;
for x in range(2, 12):
	for y in range(2, 12):
		if paper[x][y] == 0:
			cnt += 1
		if paper[x][y] > max:
			max = paper[x][y]

print(cnt, max, sep='\n')

Python: def small(x, y, a):
    a[x][y] += 1
    a[x + 1][y] += 1
    a[x - 1][y] += 1
    a[x][y + 1] += 1
    a[x][y - 1] += 1


def medium(x, y, a):
    small(x, y, a)
    a[x + 1][y + 1] += 1
    a[x - 1][y + 1] += 1
    a[x - 1][y - 1] += 1
    a[x + 1][y - 1] += 1


def large(x, y, a):
    medium(x, y, a)
    a[x + 2][y] += 1
    a[x - 2][y] += 1
    a[x][y + 2] += 1
    a[x][y - 2] += 1


p = [[0] * 13 for i in range(13)]
while 1:
    try:
        x, y, s = map(int, input().split(','))
        if s == 1:
            small(x, y, p)
        elif s == 2:
            medium(x, y, p)
        elif s == 3:
            large(x, y, p)
    except:
        break

w, dens = 0, 0
for i in range(10):
    for j in range(10):
        if p[i][j] == 0:
            w += 1
        if p[i][j] >= dens:
            dens = p[i][j]

print(w)
print(dens)