fn main [ var lines := list_break_to_lines(read_lazy(h[0])); const x := select(len(lines) > 12, 11, 101); const y := select(len(lines) > 12, 7, 103); const steps := 100; var q := [ 0, 0, 0, 0 ]; for l in lines do [ for i := 0 to len(l) do if l[i] <> '-', l[i] < '0' or l[i] > '9' then l[i] := ' '; var p := map(list_break_whitespace(l), ston); var xp := (p[0] + p[2] * steps) mod x; if xp < 0 then xp += x; var yp := (p[1] + p[3] * steps) mod y; if yp < 0 then yp += y; var qidx := 0; if xp = x shr 1 then continue; if xp > x shr 1 then qidx += 1; if yp = y shr 1 then continue; if yp > y shr 1 then qidx += 2; q[qidx] += 1; ] write(h[1], ntos(q[0] * q[1] * q[2] * q[3]) + nl); ]