output_description: Print the maximum possible positive integer that divides every element of A
  after the operations.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      A_1 A_2 \cdots A_{N-1} A_{N}
attempt: N, K = list(map(int, input().split()))
  A = [int(i) for i in input().split()]
  
  A_sum = sum(A)
  
  
  def prime_factors(n):
      i = 2
      factors = []
      while i * i <= n:
          if n % i:
              i += 1
          else:
              n //= i
              factors.append(i)
      if n > 1:
          factors.append(n)
      return factors
  
  
  factors = prime_factors(A_sum)
  
  if min(A) < K:
      print(A_sum)
  else:
      print(max(factors))
  
problem_description: Statement
  
  We have a sequence of N integers: A_1, A_2, \cdots, A_N.
  
  You can perform the following operation between 0 and K times (inclusive):
  
    * Choose two integers i and j such that i \neq j, each between 1 and N (inclusive). Add 1 to A_i and -1 to A_j, possibly producing a negative element.
  
  Compute the maximum possible positive integer that divides every element of A
  after the operations. Here a positive integer x divides an integer y if and
  only if there exists an integer z such that y = xz.
samples: [{"input": "2 3\n    8 20", "output": "7\n    \n\n7 will divide every element of A if, for example, we perform the following\noperation:\n\n  * Choose i = 2, j = 1. A becomes (7, 21).\n\nWe cannot reach the situation where 8 or greater integer divides every element\nof A.\n\n* * *"}, {"input": "2 10\n    3 5", "output": "8\n    \n\nConsider performing the following five operations:\n\n  * Choose i = 2, j = 1. A becomes (2, 6).\n  * Choose i = 2, j = 1. A becomes (1, 7).\n  * Choose i = 2, j = 1. A becomes (0, 8).\n  * Choose i = 2, j = 1. A becomes (-1, 9).\n  * Choose i = 1, j = 2. A becomes (0, 8).\n\nThen, 0 = 8 \\times 0 and 8 = 8 \\times 1, so 8 divides every element of A. We\ncannot reach the situation where 9 or greater integer divides every element of\nA.\n\n* * *"}, {"input": "4 5\n    10 1 2 22", "output": "7\n    \n\n* * *"}, {"input": "8 7\n    1 7 5 6 8 2 6 5", "output": "5"}]