Skip to content

Instantly share code, notes, and snippets.

@whatalnk
Last active August 6, 2017 02:43
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 whatalnk/a6efee6aa36d2a9b5101e40a607b78bb to your computer and use it in GitHub Desktop.
Save whatalnk/a6efee6aa36d2a9b5101e40a607b78bb to your computer and use it in GitHub Desktop.
ICPC Domestic 2004 Tax Rate Changed
# ICPC Domestic 2014
# Tax Rate Changed
# http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
while true
x, y, s = gets.chomp.split(" ").map(&:to_i)
break if x == 0 && y == 0 && s == 0
ret = 0
(1...s).each do |i|
(i...s).each do |j|
i0 = i * (100 + x) / 100
j0 = j * (100 + x) / 100
if i0 + j0 == s then
i1 = i * (100 + y) / 100
j1 = j * (100 + y) / 100
ret = [ret, i1 + j1].max()
end
end
end
puts ret
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment