about summary refs log tree commit diff
path: root/others/other/remain.py
diff options
context:
space:
mode:
Diffstat (limited to 'others/other/remain.py')
-rwxr-xr-xothers/other/remain.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/others/other/remain.py b/others/other/remain.py
new file mode 100755
index 0000000..a81da89
--- /dev/null
+++ b/others/other/remain.py
@@ -0,0 +1,11 @@
+#!/usr/bin/env python3
+from functools import reduce
+from math import gcd
+
+
+with open('remain.inp') as f:
+    f.readline()
+    s = set(map(int, f.readline().split()))
+
+with open('remain.out', 'w') as f:
+    print(abs(reduce(gcd, map(s.pop().__sub__, s))), file=f)