diff options
Diffstat (limited to 'others/other/remain.py')
-rwxr-xr-x | others/other/remain.py | 11 |
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) |