Skip to content

Instantly share code, notes, and snippets.

@chuck0523
Created January 3, 2016 10:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chuck0523/479f4b3559bd913ace4f to your computer and use it in GitHub Desktop.
Save chuck0523/479f4b3559bd913ace4f to your computer and use it in GitHub Desktop.
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