Pagini recente » Cod sursa (job #197093) | Cod sursa (job #2142975) | Cod sursa (job #1974138) | Diferente pentru dot-com/2012/runda-2 intre reviziile 8 si 9 | Cod sursa (job #2430844)
var n,i,x,a,p,ind,q,mx:longint;
begin
assign(input,'ssm.in'); reset(input);
assign(output,'ssm.out'); rewrite(output);
readln(n);
mx:=-2000000000;
for i:=1 to n do
begin
read(a);
if x<0 then
begin
x:=a;
ind:=i
end
else inc(x,a);
if x>mx then
begin
mx:=x;
q:=ind;
p:=i
end
end;
writeln(mx,' ',q,' ',p);
close(input);
close(output)
end.