#include <algorithm> #include <iostream> #include <cmath> #include <vector> using namespace std; static bool isPrime(int x) { if(x<2) return false; if(x==2) return true; if(x%2==0) return false; for(int i = 3 ;i <= sqrt(x); i+=2) { if(x %i == 0) return false; } return t...