#include #include #include #include void primes(std::vector&prime_list, int n) { if(n<2)return; prime_list.resize(n - 2); for (int i = 2; in)break; ++front_index; } } void run(int*node_list, int length, std::vector&cs,int value,int count) { for (auto c : cs) { if (c + value < length&&node_list[c + value]&prime_list,int maney,std::vector&cs) { int sum=0; for (auto v : prime_list) { if (node_list[maney-v] > 0) { sum+=node_list[maney - v]; } } sum+=maney/ cs[0]; return sum; } int main() { int n, m; std::cin >> m >> n; std::vector cs(n); for (int i = 0; i> cs.at(i); } std::sort(cs.begin(),cs.end()); std::vector prime_list; int*node_list=new int[m]; for (int i = 0; i < m;i++) { node_list[i]=-1; } node_list[0]=0; run(node_list,m,cs,0,1); primes(prime_list, m); std::cout<