//在n个数中找k个使得它们的最大公约数最大:从大到小枚举所有数的约数,找到第一个属于超过k个数的约数,即为答案。
program momo; var n,k,i,v,j,l,a,ans:longint; s:array[1..10000000]of longint; procedure qsort(x,y:longint); var i,j,mid,t:longint; begin i:=x;j:=y; mid:=s[(x+y) div 2]; repeat while s[i]>mid do i:=i+1; while s[j]<mid do j:=j-1; if i<=j then begin t:=s[i];s[i]:=s[j];s[j]:=t; i:=i+1;j:=j-1; end; until i>j; if i<y then qsort(i,y); if x<j then qsort(x,j); end; begin read(n,k); for i:=1 to n do begin read(v); for j:=1 to trunc(sqrt(v)) do if v mod j=0 then begin l:=l+1; s[l]:=j; if j<>v div j then begin l:=l+1; s[l]:=v div j; end; end; end; qsort(1,l); a:=1; for i:=1 to l-1 do begin if s[i]=s[i+1] then a:=a+1 else a:=1; if a>=k then begin ans:=s[i]; break; end; end; writeln(ans); end.