#include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) using namespace std; int main() { int vl, vr, a_d, w; scanf("%d%d%d%d", &vl, &vr, &a_d, &w); __float128 d = a_d; __float128 acc = 0; repeat (i,int(2e6)) { __float128 dt = d / (w + vr); acc += dt * w; d -= dt * (vl + vr); dt = d / (vl + w); acc += dt * w; d -= dt * (vl + vr); } printf("%.12lf\n", double(acc)); return 0; }