#include int main(){ double v1,v2,d,w; scanf("%lf %lf %lf %lf",&v1,&v2,&d,&w); double total=0; double touch=0; int direction=0; while(d>0.0000001){ if(direction==0){//右向き touch=w*d/(w+v2);//蜂が右の車にぶつかるまでの距離 total+=touch; d-=(v1+v2)*d/(w+v2);//左右の車が動いた距離を減らす direction=1; }else if(direction==1){//左向き touch=w*d/(w+v1); total+=touch; d-=(v1+v2)*d/(w+v1); direction=0; } } printf("%f\n",total); return 0; }