#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define N (1000000000+7) #define M 998244353 #define INF 1e16 typedef long long ll; typedef pair P; const int inf = (int)1e9; ll A(ll x){ if(x>=0)return x; else return -x; } ll gcd(ll a, ll b) { if (b > a) { ll tmp = b; b = a; a = tmp; } if (a%b == 0)return b; else return gcd(b, a%b); } bool prime[1000010]; ll cnt[1000010]; void furui() { int i = 2; while (i < 1000010) { int j = 2; while (j*j <= i && !prime[i]) { if (i%j == 0) { prime[i] = true; break; } else j++; } int z = 2; while (!prime[i]) { if (i*z < 1000010) { prime[i*z] = true; z++; } else break; } i++; } } int main(void){ ll n; double p; cin>>n>>p; double ans = 0.0; int i = 2; while (i <= n) { int j = 2; while (j*j <= i && !prime[i]) { if (i%j == 0) { prime[i] = true; break; } else j++; } if(!prime[i])ans+=1.0; else { double x= 1.0; for(ll k=0;k