From df20bbbebb8d5951607560d358c1a19388743113 Mon Sep 17 00:00:00 2001 From: Raphael McSinyx Date: Sun, 13 Aug 2017 00:42:13 +0700 Subject: Tài thầy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- others/other/remain.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 others/other/remain.py (limited to 'others/other/remain.py') 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) -- cgit 1.4.1