#include using namespace std; using ll = long long; #define rep(i,n) for(ll i=0;i>h>>w>>la>>lb>>ka>>kb; ll ans=1e18; rep(a,h+w+1){ ll up=h+w+1; ll dw=-1; while(up-dw>1){ ll md=(up+dw)/2; ll tmp=min(h,la*a)*min(w,lb*md)+ka*a+kb*md; if(tmp