ll a[2d5],e[2d5],d[2d5]; { ll@n,@m,@p,b=0,c=0; rd(a(n)); rep(i,n){ b>?=a[i]; while(a[i]%p<1){ a[i]/=p; ++e[i]; } c>?=a[i]; } if(b>m){ wt(0); exit(0); } if(c<2){ wt(-1); exit(0); } d[0]=1; rep(i,2d5){ if(d[i]*b>m){ wt(i+1); exit(0); } rep(j,n){ d[i+e[j]+1]>?=d[i]*a[j]; } } }