#include int main(void) { int n, x, i; float p, mean = 0; float list_of_koho[n+1]; float list_of_sosu[n+1]; scanf("%d %f", &n, &p); for (i = 2; i <= n; i++) { list_of_koho[i] = 1; list_of_sosu[i] = 0; } for (x = 2; x <= n; x++) { list_of_sosu[x] = list_of_koho[x]; list_of_koho[x] = 0; for (i = 2; x*i <= n; i++) list_of_koho[x*i] -= list_of_koho[x*i] * p; } for (i = 2; i <= n; i++) mean += list_of_sosu[i]; printf("%f\n", mean); return 0; }