fork download
  1. def parse(inFile):
  2. return inFile.getInts()[1:]
  3.  
  4. from fractions import gcd
  5.  
  6. def solve(numbers):
  7. diffs = [abs(number-numbers[0]) for number in numbers[1:]]
  8. g = reduce(gcd, diffs, 0)
  9. return (-numbers[0]) % g
  10.  
  11. if __name__ == "__main__":
  12. from GCJ import GCJ
  13. GCJ(parse, solve, "/Users/lpebody/gcj/2010_q/", "b").run()
  14.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty