#include using namespace std; int main(){ int A,B,C,D; int veg=0,meat=0,i,j; int total=0; cin>>A>>B>>C>>D; while(total<=D && veg<=A && meat<=B){ total=veg+meat; veg++; meat=veg*C; } cout<