#include #define ALL(v) std::begin(v),std::end(v) using lint=long long; using lubl=long double; void cmx(lint&x,lint y){if(x>n; std::vectorprimes; std::vectorsieve(n+1,false); for(lint p=2;p<=n;p++){ if(sieve.at(p))continue; primes.push_back(p); for(lint i=p*p;i<=n;i+=p)sieve.at(i)=true; } std::vectordp(n+1,-1); dp.at(0)=0; for(lint p:primes){ for(lint i=n-p;i>=0;i--){ if(dp.at(i)==-1)continue; cmx(dp.at(i+p),dp.at(i)+1); } } std::cout<