Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- i, min, max1, a, b, n, sum, sum2, k, x: integer;
- begin
- readln(n);
- readln(x);
- max1 := 0;
- min := x;
- sum := 0;
- for i := 2 to n do
- begin
- readln(x);
- if(x < min) then
- begin
- if(sum < max1 - min) then
- begin
- sum := max1 - min;
- a := max1;
- b := min;
- end;
- min := x;
- max1 := 0;
- end;
- if(x > max1) then max1 := x;
- end;
- writeln(sum, ' ', b, ' ', a);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement