# -*- coding: utf-8 -*- A, B, X, Y = map(int, input().split()) enou = min(X*(A+B)/A, Y*(A+B)/B) print(enou)