#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const int INF = 1e9;
int main() {
    cin.tie(nullptr); ios::sync_with_stdio(false);
    int w, d, n; cin >> w >> d >> n;
    vector<int> x(n), y(n), z(n);
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> z[i], x[i]--, y[i]--;
    vector<vector<int>> minv(w, vector<int>(d, -INF));
    vector<vector<int>> maxv(w, vector<int>(d, INF));
    for (int k = 0; k < n; k++) {
        for (int i = 0; i < w; i++) {
            for (int j = 0; j < d; j++) {
                minv[i][j] = max(minv[i][j], z[k] - abs(i - x[k]) - abs(j - y[k]));
                maxv[i][j] = min(maxv[i][j], z[k] + abs(i - x[k]) + abs(j - y[k]));
            }
        }
    }
    int ans = 0;
    for (int i = 0; i < w; i++) {
        for (int j = 0; j < d; j++) {
            if (minv[i][j] > maxv[i][j]) goto NO;
            ans += minv[i][j];
        }
    }
    cout << ans << endl;
    return 0;
NO:
    cout << "No\n";
    return 0;
}
