#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int f[N][2];

int main()
{
    int a,b,x,y;scanf("%d%d%d%d",&a,&b,&x,&y);
    memset(f,0x3f,sizeof f);
    f[a][0] = 0;
    for(int i = a;i <= 100;++i)
    {
        f[i][0] = min(f[i][0],f[i][1] + x);
        f[i][1] = min(f[i][1],f[i][0] + x);

        f[i + 1][0] = min(f[i + 1][0],f[i][0] + y);
        f[i + 1][0] = min(f[i + 1][0],f[i][1] + x);
        f[i + 1][1] = min(f[i + 1][1],f[i][1] + y);
    }
    for(int i = a;i >= 1;--i)
    {
        f[i][0] = min(f[i][0],f[i][1] + x);
        f[i][1] = min(f[i][1],f[i][0] + x);

        f[i - 1][1] = min(f[i - 1][1],f[i][0] + x);
        f[i - 1][0] = min(f[i - 1][0],f[i][0] + y);
        f[i - 1][1] = min(f[i - 1][1],f[i][1] + y);
    }
//    cout << f[100][0] << endl;
    printf("%d",f[b][1]);
    return 0;
}
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    double sx, sy, gx, gy;
    cin >> sx >> sy >> gx >> gy;
    if (gx < sx) {
        swap(sx, gx);
        swap(sy, gy);
    }
    printf("%.10lf", sx + (gx - sx) * sy / (sy + gy));
    return 0;
}