import std.algorithm, std.array, std.container, std.range, std.bitmanip; import std.numeric, std.math, std.bigint, std.random, core.bitop; import std.string, std.regex, std.conv, std.stdio, std.typecons; void main() { auto rd = readln.split.map!(to!int); auto a = rd[0], b = rd[1], x = rd[2], y = rd[3]; auto x2 = y.to!real / b * a; auto y2 = x.to!real / a * b; writefln("%.7f", min(x, x2) + min(y, y2)); }