#include <iostream>
using namespace std;
double fdif(double x,double y)
{
return x+y;
}
int main()
{
double k1, k2, k3, k4, dy, x, y0, a, b, h;
scanf("%lf %lf %lf %lf", &a, &b, &h, &y0);
for ( x ; x <= b ; x += h )
{
k1 = fdif (x , y0);
k2 = fdif (x + h / 2 , y0 + h / 2 * k1);
k3 = fdif (x + h / 2 , y0 + h / 2 * k2);
k4 = fdif (x + h , y0 + h * k3);
y0 += h * ( k1 + 2 * k2 + 2 * k3 + k4 ) / 6;
}
printf("%lf", y0);
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKZG91YmxlIGZkaWYoZG91YmxlIHgsZG91YmxlIHkpCnsKCXJldHVybiB4K3k7Cn0KCmludCBtYWluKCkgCnsKCWRvdWJsZSBrMSwgazIsIGszLCBrNCwgZHksIHgsIHkwLCBhLCBiLCBoOwoJc2NhbmYoIiVsZiAlbGYgJWxmICVsZiIsICZhLCAmYiwgJmgsICZ5MCk7Cglmb3IgKCB4IDsgeCA8PSBiIDsgeCArPSBoICkKCXsJCQoJCWsxID0gZmRpZiAoeCAsIHkwKTsKCQlrMiA9IGZkaWYgKHggKyBoIC8gMiAsIHkwICsgaCAvIDIgKiBrMSk7CgkJazMgPSBmZGlmICh4ICsgaCAvIDIgLCB5MCArIGggLyAyICogazIpOwoJCWs0ID0gZmRpZiAoeCArIGggLCB5MCArIGggKiBrMyk7CgkJeTAgKz0gaCAqICggazEgKyAyICogazIgKyAyICogazMgKyBrNCApIC8gNjsKCX0KCXByaW50ZigiJWxmIiwgeTApOwoJcmV0dXJuIDA7Cn0=