Problem:
Tax Rate Changed

VAT (value-added tax) is a tax imposed at a certain rate proportional to the sale price.

Our store uses the following rules to calculate the after-tax prices.

When the VAT rate is x%,
for an item with the before-tax price of p yen,
its after-tax price of the item is p (100+x) / 100 yen, fractions rounded off.

The total after-tax price of multiple items paid at once is
the sum of after-tax prices of the items.

The VAT rate is changed quite often.
Our accountant has become aware that
"different pairs of items that had the same total after-tax price
may have different total after-tax prices after VAT rate changes."
For example, when the VAT rate rises from 5% to 8%,
a pair of items that had the total after-tax prices of 105 yen before
can now have after-tax prices either of 107, 108, or 109 yen, as shown in the table below.

Before-tax prices of two items

After-tax price with 5% VAT

After-tax price with 8% VAT

20, 80

21 + 84 = 105

21 + 86 = 107

2, 99

2 + 103 = 105

2 + 106 = 108

13, 88

13 + 92 = 105

14 + 95 = 109

Our accountant is examining effects of VAT-rate changes on after-tax prices.
You are asked to write a program that calculates the possible maximum
total after-tax price of two items with the new VAT rate,
knowing their total after-tax price before the VAT rate change.

Input

The input consists of multiple datasets.
Each dataset is in one line,
which consists of three integers x, y, and s separated by a space.
x is the VAT rate in percent before the VAT-rate change,
y is the VAT rate in percent after the VAT-rate change,
and s is the sum of after-tax prices of two items before the VAT-rate change.
For these integers, 0 < x < 100, 0 < y < 100,
10 < s < 1000, and x ≠ y hold.
For before-tax prices of items, all possibilities of 1 yen through s-1 yen should be considered.

The end of the input is specified by three zeros separated by a space.

Output

For each dataset,
output in a line the possible maximum total after-tax price when the VAT rate is changed to y%.

Sample 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

Output for the Sample Input

109
103
24
24
26
27
225
116
62
111
230
1972
508
1004
20
7

Hints

In the following table,
an instance of a before-tax price pair that has the maximum after-tax price after the VAT-rate change
is given for each dataset of the sample input.

Dataset

Before-tax prices

After-tax price with y% VAT

5 8 105

13, 88

14 + 95 = 109

8 5 105

12, 87

12 + 91 = 103

1 2 24

1, 23

1 + 23 = 24

99 98 24

1, 12

1 + 23 = 24

12 13 26

1, 23

1 + 25 = 26

1 22 23

1, 22

1 + 26 = 27

1 13 201

1,199

1 +224 = 225

13 16 112

25, 75

29 + 87 = 116

2 24 50

25, 25

31 + 31 = 62

1 82 61

11, 50

20 + 91 = 111

1 84 125

50, 75

92 +138 = 230

1 99 999

92,899

183+1789 =1972

99 1 999

1,502

1 +507 = 508

98 99 999

5,500

9 +995 =1004

1 99 11

1, 10

1 + 19 = 20

99 1 12

1, 6

1 + 6 = 7

Solution in Rust (judge verdict: Accepted)

use std::io;
//use std::collections::HashMap;
//use std::collections::BinaryHeap;
//use std::collections::HashSet;
//use std::mem; // mem::swap(&mut x,&mut y);
use std::cmp; // cmp::max,cmp::min

// Rustメモ: https://hackmd.io/i0lQY1OKTDW1t66TECOmiw?both

#[allow(dead_code)]
fn read_line() -> String{
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
fn read_charvec() -> Vec<char>{
    read_line().chars().collect()
}

#[allow(dead_code)]
fn read_ints() -> Vec<i64>{
    let s = read_line();
    let split:Vec<&str> = s.split(" ").collect();
    split.iter().map(|&x| x.to_string().parse().unwrap()).collect()
}

#[allow(dead_code)]
fn read_int() -> i64{
    read_ints()[0]
}

#[allow(dead_code)]
fn reverse(s: &String) -> String{
    s.chars().rev().collect::<String>()
}

#[allow(dead_code)]
fn read_lines(n:i64) -> Vec<String>{
    let mut xs = Vec::new();

    for _i in 0..n{
        xs.push(read_line());
    }

    xs
}

#[allow(dead_code)]
fn read_ints2(n:i64) -> Vec<i64>{
    read_lines(n).iter().map(|x| x.parse().unwrap()).collect()
}

////////////////////////////////////////////////

fn calc(v:i64,p:i64)->i64{
    v*(100+p)/100
}

fn solve() -> bool{
    // http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
    let inputs = read_ints();
    let (x,y,s) = (inputs[0],inputs[1],inputs[2]);

    if x == 0{
        return false;
    }

    let vs : Vec<i64> = (0..(s+1)*(s+1))
        .into_iter()
        .filter(|a|{
            let left = a / (s+1) + 1;
            let right = a % (s+1) + 1;
            let left_p = calc(left,x);
            let right_p = calc(right,x);
            let ret = (left_p+right_p) == s;

            ret
        })
        .map(|a|{
            let left = a / (s+1) + 1;
            let right = a % (s+1) + 1;
            let left_p = calc(left,y);
            let right_p = calc(right,y);

            left_p+right_p
        })
        .collect();
    let max_value = vs
        .into_iter()
        .fold(-1,|a,b| cmp::max(a,b));
    println!("{}",max_value);

    true
}

fn main(){
    while solve(){}
}