about summary refs log tree commit diff
path: root/others/other/remain.py
diff options
context:
space:
mode:
authorRaphael McSinyx <vn.mcsinyx@gmail.com>2017-08-13 00:42:13 +0700
committerRaphael McSinyx <vn.mcsinyx@gmail.com>2017-08-13 00:42:13 +0700
commitdf20bbbebb8d5951607560d358c1a19388743113 (patch)
treeac91e25ccadd2c0de75494b72022c08046fffdd8 /others/other/remain.py
parentebb579dd31a19a4d08a8e9aae97c5fc354bc3e8b (diff)
downloadcp-df20bbbebb8d5951607560d358c1a19388743113.tar.gz
Tài thầy
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)