var
ans,n,m,k,i:longint;
arrive,d,t,a,b,down,latest:array[0..10001] of longint;
function mmax(a,b:longint):longint;
begin
if a>b then exit(a)
else exit(b);
end;
procedure doit;
var
i,j,max,tip,pos:longint;
begin
for i:=2 to n do
arrive[i]:=mmax(arrive[i-1],latest[i-1])+d[i-1]; //求出每一站的到站时间,每用一次加速器,d[i]都会变化,arrive[i]也会变化,所以每次都要更新
// max(arrive[i-1],lastest[i-1])意思是找到应该发车的时间
pos:=0; //pos表示即将找到的要用加速器的站点位置
max:=0; //max加速器能作用人数的最大值
for i:=1 to n-1 do //枚举各个站点来找pos
if d[i]>0 then //保证行车时间>0
begin
tip:=0; //tip表示求每次加速器能作用的人数
for j:=i+1 to n do //从每个站的后面开始找tip
begin
tip:=tip+down[j];
if arrive[j]<=latest[j] then break; //如果不会影响后面了就停止 条件是车到站之后还要等乘客或者乘客刚好到,
//因为使用加速器之后到达时间会变早,所以就算这次乘客刚到,
//在前面用了加速器之后也不会影响这一站之后的
end;
if tip>max then
begin
max:=tip; //max加速器能作用人数的最大值,在这一步求出
pos:=i; //记下最大作用站点的位置
end;
end;
dec(d[pos]); //在pos这个站点使用加速器
dec(k); //用了一个加速器,k-1
end;
begin
readln(n,m,k);
for i:=1 to n-1 do read(d[i]); //d[i]表示路程上消耗的时间
for i:=1 to m do
begin
readln(t[i],a[i],b[i]);
if latest[a[i]]<t[i] then latest[a[i]]:=t[i]; //latest[i]表示最后一个人到第i站的时间
inc(down[b[i]]); //down[i]表示第i站下车人数 统计每站下车人数
end;
arrive[1]:=latest[1]; //arrive[i]表示最早到站时间 这一步暂不明白有何用,看起来可以去掉
while k>0 do doit;
for i:=2 to n do
arrive[i]:=mmax(arrive[i-1],latest[i-1])+d[i-1];//更新一下最后用的那个加速器
ans:=0; //加速器用完了,现在开始求答案
for i:=1 to m do //一共m个人
ans:=ans+arrive[b[i]]-t[i]; //t[i]表示上车时间,b[i]是下车站点,arrive[b[i]]就是下车时间
writeln(ans);
end.