#pragma GCC optimize("Ofast") #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pii; typedef pair pil; typedef pair pli; typedef pair pll; templateconstexpr bool chmin(T&a,const U b){if(a<=b)return false;a=b;return true;} templateconstexpr bool chmax(T&a,const U b){if(a>=b)return false;a=b;return true;} #define bit(n,k) ( (n>>k)&1 ) //デバッグ template void Vout(vector &V){ cout<<"\nstart\n"; const int sz=V.size(); for(int i=0;i void VPout(vector &V){ cout<<"\nstart\n"; const int sz=V.size(); for(int i=0;i> data(3, vector(4)); //vector.resize(a,vector(b,-1)); //vector>> 変数名(要素数1, vector>(要素数2, vector<要素の型>(要素数3, 初期値))); signed main(){ ios::sync_with_stdio(false); cin.tie(nullptr); cout<>N>>p; double ret=0; vector ans(N+1,1); for(int i=2;i<=N;i++){ ret+=ans[i]; for(int j=i*2;j<=N;j+=i){ ans[j]*=(1-p); } } cout<