#include #define pt(sth) cout << sth << "\n" #define itr(x,c) for(auto x=c.begin();x!=c.end();x++) #define ritr(x,c) for(auto x=c.rbegin();x!=c.rend();x++) #define all(a) (a.begin()),(a.end()) #define rall(a) (a.rbegin()),(a.rend()) using namespace std; #include using namespace atcoder; typedef long long ll; typedef pair pll; templatebool chmax(T &a, const T &b) {if(abool chmin(T &a, const T &b) {if(b>a[i]; typedef vector v1d; typedef vector v2d; typedef vector v3d; typedef vector v4d; v1d eratos(ll N) { v1d primes; v1d isp(N+5,1); isp[0]=isp[1]=0; ll i,j; for(i=2; i*i<=N; i++) { if(isp[i]==0) continue; for(j=i+i; j<=N; j+=i) isp[j]=0; } for(i=0; i<=N; i++) if(isp[i]) primes.push_back(i); return primes; } template struct PrimeFact { vector spf; PrimeFact(T N) { init(N); } void init(T N) { // 前処理。spf を求める spf.assign(N + 1, 0); for (T i = 0; i <= N; i++) spf[i] = i; for (T i = 2; i * i <= N; i++) { if (spf[i] != i) continue; for (T j = i + i; j <= N; j += i) { spf[j] = i; } } } map get(T n) { // nの素因数分解を求める map m; while (n != 1) { m[spf[n]]++; n /= spf[n]; } return m; } }; int main(void) { ll i,j,k; /* ll N;cin>>N; v1d a(N); for(i=0;i>a[i]; */ v1d pri=eratos(1000); map dic; i=0; for(auto p:pri){ dic[p]=i;i++; } PrimeFact pf(1000); ll N,K;cin>>N>>K; v1d a(N); v2d f(N,v1d(pri.size(),0)); for(i=0;i>a[i]; map mp=pf.get(a[i]); itr(it,mp) f[i][dic[it->first]]=it->second; } set st; for(ll S=0;S<1<>i&1)t+=a[i]; map mp=pf.get(t); v1d v(pri.size(),0); itr(it,mp) v[dic[it->first]]=it->second; st.insert(v); v1d cnt(pri.size(),0); v1d u; for(i=0;i>i&1)u.push_back(i); for(auto c:u){ for(auto p:pri){ cnt[dic[p]]+=f[c][dic[p]]; } } st.insert(cnt); } pt(st.size()); }