Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- a:array[1..10000] of integer;
- i,n,j,maxs,e1,e2:integer;
- begin
- maxs:=-1; e1:=0; e2:=0;
- read(n);
- for i:1 to n do begin
- read(a[i]);
- for j:1 to n do begin
- read(a[j]);
- if (abs(a[i]-a[j]) mod 2 = 0) and (a[i]+a[j] > maxs) and ((a[i] mod 27 = 0) or (a[j] mod 27 = 0)) then begin
- maxs:= a[i] + a[j];
- e1:=a[i];
- e2:=a[j];
- end;
- end;
- end;
- if maxs > 0 then
- write(e1, " ", e2)
- else
- write(00);
- end.
Advertisement
Add Comment
Please, Sign In to add comment