#include using namespace std; typedef signed long long ll; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(x,to) for(x=0;x M; void cprime() { for(int i=2;i>N>>P; P=1-P; cprime(); for(i=2;i<=N;i++) { y=x=i; double hoge=1; vector V; for(j=0;prime[j]*prime[j]<=x;j++) { if(x%prime[j]==0) { r=0; while(x%prime[j]==0) r++, x/=prime[j]; V.push_back(r); } } if(x!=i && x>1) V.push_back(1); y=1; ITR(it,V) y*=(1+*it); if(y==1) y=0; else y-=2; while(y--) hoge *=P; ret += hoge; } _P("%.12lf\n",ret); } int main(int argc,char** argv){ string s;int i; if(argc==1) ios::sync_with_stdio(false); FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin); solve(); return 0; }