Tax Rate Changed
Time limit1sMemory limit256 MB
Find the pair of pre-tax prices that summed to s after x% tax and gives the largest total after y% tax.
- Level
Easy2 of 10
- Topics
- Brute force, Math
- Solved
- No attempts yet
Problem
With VAT rate x%, the after-tax price of a before-tax price p is . Two items once had a combined after-tax total of s yen. After the rate changes to y%, what is the largest combined after-tax total achievable by some pair of before-tax prices that used to total s?
Input
Multiple datasets, one per line: x, y, s. Input ends with 0 0 0. Consider every before-tax price from 1 through s-1 for each item.
Output
For each dataset, print the maximum possible combined after-tax total at rate y%.