A, B, C, D = gets.split.map(&:to_i) 100.downto(0) do |x| yasai = x niku = x * C next if D < yasai + niku puts x break end