#include double calc(int depth,int p,int q){ if(depth>=20){ return 0.5; } if(p<=0){ return 1.0/3.0+calc(depth+1,q,q)/3.0; } else if(p>=100){ return 1.0/2.0+calc(depth+1,100-q,q)/2.0; } return (1.0/2.0+calc(depth+1,p-q,q)/2.0)*p/100.0 +(1.0/3.0+calc(depth+1,p+q,q)/3.0)*(100-p)/100.0; } void run(void){ int p,q; scanf("%d%d",&p,&q); double ans=1.0/3.0+calc(0,p,q)/3.0; printf("%.6lf\n",ans); return; } int main(void){ run(); return 0; }