local function reada(n,m)m=m or 1 r={}for i=1,m do r[i]={}end for i=1,n do for j=1,m do r[j][i]=io.read"*n"end end return table.unpack(r)end
N=io.read"*n"
K=io.read"*n"
A=reada(N)
s=0
for i=1,N do s=s+A[i]end
d={}
for i=1,math.sqrt(s)+1 do
	if(s%i==0)then
		table.insert(d,i)
		if(i~=math.floor(s/i))then
			table.insert(d,math.floor(s/i))
		end
	end
end
table.sort(d,function(a,b)return a>b end)
print(table.concat(d," "))
for _,d in ipairs(d)do
	t=0
	for i=1,N do
		t=t+math.abs(math.min(A[i]%d,d-A[i]%d))
	end
	if(t<=K)then print(d) return end
end