#include using namespace std; using ll = long long; int main() { int n; double p; cin >> n >> p; p = 1.0 - p; vector ps(n + 1, 1.0); ps[0] = ps[1] = 0; for(int i = 2; i <= n; i++) { for(int j = i + i; j <= n; j += i) { ps[j] *= p; } } // print(ps); // for(int i = 0; i <= n; i++)cerr << i << ": " << ps[i] << endl; cout << fixed <