{ NOTE: it is recommended to use this even if you don't understand the following code } const MAXM = 200000; MAXQ = 50000; var M, N, Q, i : LongInt; A, B, C : Array[0..MAXM-1] of LongInt; { event i: T[i] = 1 -> X[i], K[i], V[i]; T[i] = 2 -> L[i], R[i] } T, X, K, V, L, R : Array[0..MAXQ-1] of LongInt; Answer : Array[0..MAXQ-1] of Int64; { the answer of each type 2 event } begin { uncomment the two following lines if you want to read/write from files assign(input, 'input.txt'); reset(input); assign(output, 'output.txt'); rewrite(output); } ReadLn(N, M, Q); for i:=0 to M-1 do ReadLn(A[i], B[i], C[i]); for i:=0 to Q-1 do begin Read(T[i]); if T[i] = 1 then ReadLn(X[i], K[i], V[i]) else ReadLn(L[i], R[i]); Answer[i] := 0; end; { INSERT YOUR CODE HERE } for i:=0 to Q-1 do if T[i] = 2 then WriteLn(Answer[i]); end.