about summary refs log tree commit diff
path: root/others/volume1/033.pas
blob: 2d8a77a2f89356911f017bc994236d791874f128 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
uses clib;

var
  n, i: int16;
  a: intar;
  max, tmp: int64;

begin
  readln(n);
  setlength(a, n * 2);
  for i := 0 to n * 2 - 1 do
    read(a[i]);
  qsort(a);
  max := a[0] + a[n * 2 - 1];
  for i := 1 to n - 1 do
    begin
      tmp := a[i] + a[n * 2 - i - 1];
      if tmp > max then
        max := tmp
    end;
  writeln(max)
end.