#include <bits/stdc++.h>
using namespace std;

int w, d, n;
vector<vector<int>> upper(52, vector<int>(52, 10000));
vector<vector<int>> lower(52, vector<int>(52, -10000));

signed main() {
    ios::sync_with_stdio(0); cin.tie(0);

    cin >> w >> d >> n;
    while (n--) {
        int x, y, z; cin >> x >> y >> z;
        for (int i = 1; i <= w; i++) {
			for (int j = 1; j <= d; j++) {
                int man_dist = abs(i - x) + abs(j - y);
				upper[i][j] = min(upper[i][j], z + man_dist);
				lower[i][j] = max(lower[i][j], z - man_dist);
			}
        }
    }

    int ans = 0;
    for (int i = 1; i <= w; i++) {
		for (int j = 1; j <= d; j++) {
            if (lower[i][j] <= upper[i][j]) {
				ans += lower[i][j];
            } else {
				cout << "No\n";
				exit(0);
            }
		}
    }
    cout << ans << '\n';

    return 0;
}

