about summary refs log tree commit diff
path: root/others/volume1/033.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/033.pas')
-rw-r--r--others/volume1/033.pas22
1 files changed, 22 insertions, 0 deletions
diff --git a/others/volume1/033.pas b/others/volume1/033.pas
new file mode 100644
index 0000000..2d8a77a
--- /dev/null
+++ b/others/volume1/033.pas
@@ -0,0 +1,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.