#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define rep(i,a) for(int i=(int)0;i<(int)a;++i) #define pb push_back #define eb emplace_back using ll=long long; constexpr ll mod = 1e9 + 7; constexpr ll INF = 1LL << 50; template inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } template inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } using namespace std; vector< bool > prime_table(int n) { vector< bool > prime(n + 1, true); if(n >= 0) prime[0] = false; if(n >= 1) prime[1] = false; for(int i = 2; i * i <= n; i++) { if(!prime[i]) continue; for(int j = i + i; j <= n; j += i) { prime[j] = false; } } return prime; } void solve(){ int n; cin>>n; int ans=0; vectorv=prime_table(n); vectorvv; rep(i,v.size()){ if(v[i]==true)vv.pb(i); } for(int i=2;i<=sqrt(2*n);++i){ if(v[i]==false)continue; for(auto x:vv){ if(i*i-x>n||i*i-x<0)continue; if(v[i*i-x]==true)++ans; } } cout<