#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 55

struct LOC{
	LOC(){
		x = y = z = 0;
	}

	LOC(int arg_x,int arg_y,int arg_z){
		x = arg_x;
		y = arg_y;
		z = arg_z;
	}
	int x,y,z;
};

int H,W,N;
LOC loc[SIZE];
bool used[SIZE][SIZE];

int main(){

	scanf("%d %d %d",&W,&H,&N);

	for(int row = 0; row < H; row++){
		for(int col = 0; col < W; col++){

			used[row][col] = false;
		}
	}

	int ans = 0;

	for(int i = 0; i < N; i++){

		scanf("%d %d %d",&loc[i].x,&loc[i].y,&loc[i].z);
		loc[i].x--;
		loc[i].y--;
		used[loc[i].y][loc[i].x] = true;

		ans += loc[i].z;
	}

	for(int i = 0; i < N-1; i++){
		for(int k = i+1; k < N; k++){

			int diff_z = abs(loc[i].z-loc[k].z);
			int diff_x = abs(loc[i].x-loc[k].x);
			int diff_y = abs(loc[i].y-loc[k].y);

			if(diff_z > diff_x+diff_y){

				printf("No\n");
				return 0;
			}
		}
	}

	for(int x = 0; x < W; x++){
		for(int y = 0; y < H; y++){
			if(used[y][x])continue;

			int maximum = -BIG_NUM;
			for(int i = 0; i < N; i++){

				int diff_x = abs(loc[i].x-x);
				int diff_y = abs(loc[i].y-y);
				maximum = max(maximum,loc[i].z-(diff_x+diff_y)); //なるべく低くする
			}

			used[y][x] = true;
			ans += maximum;
		}
	}

	printf("%d\n",ans);
}


