This page is still under construction.

Parts of this page are still being built. What you see may change.

Tax Rate Changed

Time limit1sMemory limit256 MB

Summary
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 ⌊p(100+x)/100⌋\lfloor p(100+x)/100 \rfloor. 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%.

Examples5

  1. Example 1

    Input
    5 8 105
    8 5 105
    1 2 24
    99 98 24
    12 13 26
    1 22 23
    1 13 201
    13 16 112
    2 24 50
    1 82 61
    1 84 125
    1 99 999
    99 1 999
    98 99 999
    1 99 11
    99 1 12
    0 0 0
    
    Expected output
    109
    103
    24
    24
    26
    27
    225
    116
    62
    111
    230
    1972
    508
    1004
    20
    7
    
  2. Example 2

    Input
    10 20 50
    0 0 0
    
    Expected output
    55
    
  3. Example 3

    Input
    5 10 30
    0 0 0
    
    Expected output
    32
    
  4. Example 4

    Input
    1 50 20
    0 0 0
    
    Expected output
    30
    
  5. Example 5

    Input
    50 1 20
    0 0 0
    
    Expected output
    14