Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- mn, mx: array [0..59] of integer;
- i, n, x, res1, res2, res: integer;
- begin
- readln(n);
- for i:=0 to 59 do begin
- mx[i] := 0; mn[i] := 10001;
- end;
- for i:=1 to n do
- begin
- readln(x);
- if x > mx[x mod 60] then mx[x mod 60] := x;
- if x < mn[x mod 60] then mn[x mod 60] := x;
- end;
- res := -1;
- for i:=0 to 59 do begin
- if ((mx[i] - mn[i]) > res) and (mn[i] <> mx[i]) and (mx[i] <> 0) then
- begin
- res := mx[i] - mn[i];
- res1 := mn[i]; res2 := mx[i];
- end;
- end;
- if res = -1 then writeln ('00')
- else writeln (res1, ' ', res2);
- end.
Add Comment
Please, Sign In to add comment