#include #include #include using namespace std; using namespace atcoder; using mint = modint998244353; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf32 1000000001 #define Inf64 2000000000000000001 int main(){ int N,K; cin>>N>>K; vector a(N); rep(i,N)cin>>a[i]; vector y; rep(i,N){ for(long long j=1;j*j<=a[i];j++){ if(a[i]%j==0){ y.push_back(j); y.push_back(a[i]/j); } } } sort(y.begin(),y.end()); y.erase(unique(y.begin(),y.end()),y.end()); long long ans = 1; rep(i,y.size()){ long long sum = 0; rep(j,N){ sum += min(a[j]%y[i],y[i] - (a[j]%y[i])); } if(sum<=K)ans = y[i]; } cout<