vegetable, meat, rate, limit = gets.split.map &:to_i p [vegetable, meat / rate, limit / (1 + rate)].min