Last active
August 6, 2017 02:43
-
-
Save whatalnk/a6efee6aa36d2a9b5101e40a607b78bb to your computer and use it in GitHub Desktop.
ICPC Domestic 2004 Tax Rate Changed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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