#include int main(){ // 野菜の数・肉の数・比率・許容量 int vegetables, meat, proportion, all; scanf("%d%d%d%d",&vegetables,&meat,&proportion,&all); if(vegetables + meat < all){ printf("%d",meat / proportion); }else{ printf("%d",all / (proportion + 1)); } }