about summary refs log tree commit diff
path: root/others/volume1/034.pas
diff options
context:
space:
mode:
Diffstat (limited to 'others/volume1/034.pas')
-rw-r--r--others/volume1/034.pas14
1 files changed, 14 insertions, 0 deletions
diff --git a/others/volume1/034.pas b/others/volume1/034.pas
new file mode 100644
index 0000000..1e34793
--- /dev/null
+++ b/others/volume1/034.pas
@@ -0,0 +1,14 @@
+uses math, sortnfind;
+
+var
+  n, i: int16;
+  a: array of int64;
+
+begin
+  readln(n);
+  setlength(a, n);
+  for i := 0 to n - 1 do
+    read(a[i]);
+  qsort(a);
+  writeln(max(a[0] * a[1], a[n - 2] * a[n - 1]))
+end.