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 = map(int, input().split())
  a = list(map(int, input().split()))
  sun = sum(a)
  cd = []
  rcd = []
  for i in range(1, int(sun**0.5) + 1):
      if sun % i == 0:
          cd.append(i)
          rcd.append(sun // i)
  rcd.reverse()
  if cd[-1] == rcd[0]:
      del cd[-1]
  gcd = cd + rcd
  gcd.reverse()
  count = 0
  while True:
      g = gcd[count]
      b = list(map(lambda x: x % g, a))
      moon = sum(b) // g
      b.sort()
      luna = sum(b[: n - moon])
      if luna <= k:
          print(g)
          break
      count += 1
  
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"}]