Skip to content

Instantly share code, notes, and snippets.

@chuck0523

chuck0523/024_a.rb

Created Jan 3, 2016
Embed
What would you like to do?
a, b, c, k = gets.chomp.split.map(&:to_i)
s, t = gets.chomp.split.map(&:to_i)
discount = 0
if s + t >= k then
discount = c * ( s + t )
end
puts a * s + b * t - discount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment