#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(int i=0;i> H >> W >> K; map m; for(i=1;i<=K;i++){ ll x,y,v; cin >> x >> y >> v; m[P(x,y)]=v; } ll ans=0; for(i=1;i<=H;i++){ for(j=1;j<=W;j++){ for(auto a : m){ k=a.first.first; l=a.first.second; if(k+l