/*--------------------------------------------------------------*/
/* ACM ICPC 2009-2010, NEERC                                    */
/* Northern Subregional Contest                                 */
/* St Petersburg, October 17, 2009                              */
/*--------------------------------------------------------------*/
/* Problem C. Circles on a Screen                               */
/*                                                              */
/* Original idea         Georgiy Korneev                        */
/* Problem statement     Oleg Davydov                           */
/* Testset               Oleg Davydov                           */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Georgiy Korneev                        */
/*--------------------------------------------------------------*/
 
import java.util.*;
import java.io.*;

public class circles_gk_check implements Runnable {
    static final int MAX_W = 1000000;
    static final int MAX_R = 2000000;
    static final int MAX_N = 1000;

    static Scanner in;
    static PrintWriter out;

    private static class Segment implements Comparable<Segment> {
        final long min;
        final long max;

        public Segment(long min, long max) {
            this.min = min;
            this.max = max;
        }

        public int compareTo(Segment that) {
            return (int) (this.min - that.min);
        }
    }

    long sqrt(long x) {
        long r = Math.round(Math.sqrt(x));
        return (r * r <= x) ? r : r - 1;
    }

    public void run() {
        long w = in.nextInt();
        long h = in.nextInt();
        int n = in.nextInt();

        assert (1 <= w && w <= MAX_W);
        assert (1 <= h && h <= MAX_W);
        assert (1 <= n && n <= MAX_N);

        long[] x = new long[n];
        long[] y = new long[n];
        long[] r = new long[n];

        for (int i = 0; i < n; i++) {
            x[i] = in.nextInt();
            y[i] = in.nextInt();
            r[i] = in.nextInt();

            assert (0 <= x[i] && x[i] <= w);
            assert (0 <= y[i] && y[i] <= h);
            assert (0 <= r[i] && r[i] <= MAX_R);
        }

        long area = 0;
        for (int c = 0; c < w; c++) {
            List<Segment> segments = new ArrayList<Segment>();
            for (int i = 0; i < n; i++) {
                long d = r[i] * r[i] - (c - x[i]) * (c - x[i]);
                if (d >= 0) {
                    long z = sqrt(d);
                    segments.add(new Segment(Math.max(0, y[i] - z), Math.min(y[i] + z, h - 1)));
                }
            }
            Collections.sort(segments);
            long last = -1;
            long a = 0;
            for (Segment segment : segments) {
                //System.out.print("[" + segment.min + ", " + segment.max + "] ");
                if (last < segment.min) {
                    last = segment.min - 1;
                }
                if (segment.max >= last) {
                    //System.out.print(segment.max - last + " ");
                    a += segment.max - last;
                }
                last = Math.max(last, segment.max);
            }
            area += a;
            System.out.println(a);
        }

        out.println(w * h - area);
    }

    public static void main(String[] args) throws Exception {        
        in = new Scanner(new File("circles.in"));
        out = new PrintWriter("circles.out");

        new circles_gk_check().run();

        in.close();
        out.close();
    }
}
