LINEGAME - VOI09 Trò chơi với băng số
Tác giả: flashmt
Ngôn ngữ: Pascal
uses math;
var n,i:longint;
x,y,s,z:int64;
begin
read(n);
x:=-1000000; y:=0;
for i:=1 to n do
begin
read(s);
z:=y;
y:=max(y,x-s);
x:=max(x,z+s);
end;
writeln(max(x,y));
end.