#include #include #include using namespace std; int main() { double N, p; cin >> N >> p; int N_int = (int)N; double ans = 0; unordered_map memo; for (int i = 2; i <= N_int; i++) { for (int j = i; j <= N_int; j += i) { memo[j] += 1; } ans += pow(1 - p, memo[i]-1); } cout << ans << endl; return 0; }