#include using namespace std; using ll = long long; /*********************************/ template inline ostream& operator<<(ostream& os,vector arr) {os << "["; for(int i = 0; i < (int)arr.size(); i++)os << arr[i] << (i == (int)arr.size() - 1 ? "]" : ",");os << endl;return os;} template ostream& operator<<(ostream& os, const pair& p){os << "{" << p.first << "," << p.second << "}";return os; } #define prvec(v) cerr<<#v<<": [";for(int __i = 0;__i < (int)(v).size(); __i++)cerr<<((v)[__i])<<(__i+1==(int)(v).size()?"]\n":","); #define print(x) cerr<<#x<<": "<<(x)<> 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 << accumulate(ps.begin(), ps.end(), 0.0) << endl; }