about summary refs log tree commit diff
path: root/others/other/remain.py
blob: a81da898dc1ebe94f07271fb5180b3082fcba3d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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)