#abc136e. [abc136_e]Max GCD

[abc136_e]Max GCD

Problem Statement

We have a sequence of NN integers: A1,A2,cdots,ANA_1, A_2, \\cdots, A_N.

You can perform the following operation between 00 and KK times (inclusive):

  • Choose two integers ii and jj such that ineqji \\neq j, each between 11 and NN (inclusive). Add 11 to AiA_i and \-1\-1 to AjA_j, possibly producing a negative element.

Compute the maximum possible positive integer that divides every element of AA after the operations. Here a positive integer xx divides an integer yy if and only if there exists an integer zz such that y=xzy = xz.

Constraints

  • 2leqNleq5002 \\leq N \\leq 500
  • 1leqAileq1061 \\leq A_i \\leq 10^6
  • 0leqKleq1090 \\leq K \\leq 10^9
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN KK A1A_1 A2A_2 cdots\\cdots AN1A_{N-1} ANA_{N}

Output

Print the maximum possible positive integer that divides every element of AA after the operations.


Sample Input 1

2 3
8 20

Sample Output 1

7

77 will divide every element of AA if, for example, we perform the following operation:

  • Choose i=2,j=1i = 2, j = 1. AA becomes (7,21)(7, 21).

We cannot reach the situation where 88 or greater integer divides every element of AA.


Sample Input 2

2 10
3 5

Sample Output 2

8

Consider performing the following five operations:

  • Choose i=2,j=1i = 2, j = 1. AA becomes (2,6)(2, 6).
  • Choose i=2,j=1i = 2, j = 1. AA becomes (1,7)(1, 7).
  • Choose i=2,j=1i = 2, j = 1. AA becomes (0,8)(0, 8).
  • Choose i=2,j=1i = 2, j = 1. AA becomes (1,9)(-1, 9).
  • Choose i=1,j=2i = 1, j = 2. AA becomes (0,8)(0, 8).

Then, 0=8times00 = 8 \\times 0 and 8=8times18 = 8 \\times 1, so 88 divides every element of AA. We cannot reach the situation where 99 or greater integer divides every element of AA.


Sample Input 3

4 5
10 1 2 22

Sample Output 3

7

Sample Input 4

8 7
1 7 5 6 8 2 6 5

Sample Output 4

5