#include using namespace std; #define pb push_back typedef long long ll; const ll INF = 1000000000000000000ll; const ll MOD = 1000000007ll; const double EPS = 1e-8; int dp[20001]; const int N = 20000; bool is_prime[N+1]; vector prime; void Eratos(){ for(int i=0; i> n; for(int i=0; i<=n; i++){ dp[i] = -1; } dp[0] = 0; for(int i=0; i=0; j--){ if(j-prime[i] >=0 && dp[j-prime[i]] >= 0){ dp[j] = max(dp[j], dp[j-prime[i]] + 1); } } } /* for(int i=0; i<=n; i++){ printf("%d ", dp[i]); } puts(""); */ cout << dp[n] << endl; return 0; }