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 itemsAfter-tax price with 5% VATAfter-tax price with 8% VAT

    
20, 8021 + 84 = 10521 + 86 = 107

    
2, 992 + 103 = 1052 + 106 = 108

    
13, 8813 + 92 = 10514 + 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 &#8800; 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.
  

  
DatasetBefore-tax pricesAfter-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,899183+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



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


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

Submission status: Runtime Error

Solution code:
from math import ceil, floor

def tax(a, t):
    return floor(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

while True:
    x, y, s = map(int, input().split())
    if x == 0: break

    ls = []
    for i in range(s):
        j = i
        while tax_sum(i,j,x) <= s:
            if tax_sum(i,j,x) == s:
                ls.append((i,j))
            j += 1
    ans = 0
    for c in ls:
        ans = max(ans, tax_sum(c[0], c[1], y))
    print(ans)
#    ls = [i + 1 for i in range(s) if tax(i,x) < s]
#    ans = 0
#    for i in ls:
#        j = max(ls) - i
#
#        print(i,j,tax(i, y) + tax(j, y))
#        ans = max(ans, tax(i, y) + tax(j, y))
#
#    print(ans)
#
#    org = ceil(s * (100 - x) / 100)
#    print(org)
#
#    for i in range(ceil(org / 2)):
#        j = org - i
#        print(tax(i, y) + tax(j, y))

Submission status: Runtime Error

Solution code:
from math import floor

def tax(a, t):
    return floor(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

while True:
    x, y, s = map(int, input().split())
    if x == 0: break

    ls = []
    ans = 0
    for i in range(s):
        j = i
        while tax_sum(i,j,x) <= s:
            if tax_sum(i,j,x) == s:
                ans = max(ans, tax_sum(i,j,y))
            j += 1
    print(ans)

Submission status: Runtime Error

Solution code:
def tax(a, t):
    return int(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

while True:
    x, y, s = map(int, input().split())
    if x == 0: break

    ls = []
    ans = 0
    for i in range(s):
        j = i
        while tax_sum(i,j,x) <= s:
            if tax_sum(i,j,x) == s:
                ans = max(ans, tax_sum(i,j,y))
            j += 1
    print(ans)

Submission status: Runtime Error

Solution code:
def tax(a, t):
    return int(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

while True:
    x, y, s = map(int, input().split())
    if x == 0: break

    ls = []
    ans = 0
    for i in range(1,s):
        for j in range(i,s):
            if tax_sum(i,j,x) == s:
                ans = max(ans, tax_sum(i,j,y))
    print(ans)

Submission status: Runtime Error

Solution code:
def tax(a, t):
    return int(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

if __name__ == "__main__":
    while True:
        x, y, s = map(int, input().split())
        if x == 0: break
        ls = []
        ans = 0
        for i in range(1,s):
            for j in range(i,s):
                if tax_sum(i,j,x) == s:
                    ans = max(ans, tax_sum(i,j,y))
        print(ans)

Submission status: Runtime Error

Solution code:
def tax(a, t):
    return int(a * (100 + t) / 100)

def tax_sum(a, b, t):
    return tax(a, t) + tax(b, t)

while True:
    x, y, s = map(int, input().split())
    if x == 0:
        break
    ans = 0
    for i in range(1,s):
        for j in range(i,s):
            if tax_sum(i,j,x) == s:
                ans = max(ans, tax_sum(i,j,y))
    print(ans)

Submission status: Runtime Error

Solution code:
def calRate(m, r):
    return int(m * (100 + r) / 100)

while True:
    x, y, s = map(int, input().split())
    if x == 0 and y == 0 and s == 0: break
    ans = 0
    for i in range(1, s):
        for j in range(1, s):
            if calRate(i, x) + calRate(j, x) == s:
                ans = max(ans, calRate(i, y) + calRate(j, y))
    print(ans)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

while True:
    x,y,s = map(int,input().split())
    if (x,y,s) == (0,0,0):
        break
    ans = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            if i*(100+x)//100 + j*(100+x)//100== s:
                ans = max(ans,i*(100+y)//100 + j*(100+y)//100)
    print(ans)

Submission status: Runtime Error

Solution code:

def tax(p, x):
	return p * (100 + x) // 100

while True:
	x, y, s = map(int, input().split())
	if (x, y, s) == (0, 0, 0):
		break
	r = 0
	for i in range(1, s):
		for j in range(1, s):
			if (tax(i, x) + tax(j, x)) == s:
				r = max((tax(i, y) + tax(j, y)), r)
	print(r)

Submission status: Runtime Error

Solution code:
g = lambda rate, price: price * (100 + rate) // 100

while True:
    x, y, s = map(int, input().split())
    if x == y == s == 0:
        break
    maximum = -1
    for i in range(1, s):
        for j in range(1, s):
            if g(x, i) + g(x, j) == s:
                maximum = max(maximum, g(y, i) + g(y, j))
    print(maximum)

Submission status: Runtime Error

Solution code:
import sys

def tax(p,x):
    return int(p*(100+x)/100)


while True:
    x,y,s=[int(i) for i in  input().split(" ")]

    if x==0 and y==0 and s==0:
        sys.exit()

    maximum=0
    for i in range(1,s-1):
        for j in range(1,s-1):
            if tax(i,x)+tax(j,x)==s:
                maximum=max(tax(i,y)+tax(j,y),maximum)

    print(maximum)

Submission status: Runtime Error

Solution code:
import math


def ri(): return int(input())
def rli(): return list(map(int, input().split()))


def tax(p, rate):
    return math.floor(p*(100+rate)/100)

ans = 0
x, y, s = rli()
while(x != 0 or y != 0 or s != 0):
    for i in range(1,1000):
        for j in range(1,1000):
            if(tax(i, x) + tax(j, x) == s):
                ans = max(ans, tax(i, y) + tax(j, y))
    print(ans)
    ans = 0
    x, y, s = rli()

Submission status: Runtime Error

Solution code:
if __name__ == "__main__":
    while 1:
        x,y,z = list(map(int,input().strip().split()))
        if x ==0 and y ==0 and z ==0:break
        data = []
        for i in range(1,z):
            t1 = i + int(i *  x/100)
            for j in range(1,z):
                t2 = j + int(j * (x/100))
                if t1 + t2 == z:data.append([i,j])
        ans = 0
        for k in data:
            temp = k[0] + int(k[0]* (y/100)) + k[1] + int(k[1]* y/100)
            if  temp > ans: ans = temp
        print(ans)

Submission status: Runtime Error

Solution code:
#Name: Hidemi_Nakamura
#Seat: ????????????????????????
#URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
#Problem_Title: Tax_Rate_Changed
#Impression&Review: ?????????????????????????????????????????????????????????????????????????????????


#Taxed = int(p*(1+x/100))
flg = 1
d = [0]

while flg > 0:
    inp = input().split()
    d.append(inp)
    flg = int((inp[0]))**2+int((inp[1]))**2+int((inp[2]))**2

for i in range(1,len(d)-1):
    x = int(d[i][0])
    y = int(d[i][1])
    s = int(d[i][2])
    M = 0
    for j in range(1,s-1):
        for k in range(1,s-1):
            for l in range(1,s-1):
                a = int(k*(1+x/100))
                b = int(l*(1+x/100))
                if (a+b) == s:
                    M = max(M,(a+b))
    print(M)

Submission status: Runtime Error

Solution code:
#Name: Hidemi_Nakamura
#Seat: ????????????????????????
#URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
#Problem_Title: Tax_Rate_Changed
#Impression&Review: ?????????????????????????????????????????????????????????????????????????????????


#Taxed = int(p*(1+x/100))
flg = 1
d = [0]

while flg > 0:
    inp = input().split()
    d.append(inp)
    flg = int((inp[0]))**2+int((inp[1]))**2+int((inp[2]))**2

for i in range(1,len(d)-1):
    x = int(d[i][0])
    y = int(d[i][1])
    s = int(d[i][2])
    M = 0
    for k in range(1,s-1):
        for l in range(1,s-1):
            a = int(k*(1+x/100))
            b = int(l*(1+x/100))
            if (a+b) == s:
                M = max(M,(a+b))
    print(M)

Submission status: Runtime Error

Solution code:
flg = 1
d = [0]

while flg > 0:
    inp = input().split()
    d.append(inp)
    flg = int((inp[0]))**2+int((inp[1]))**2+int((inp[2]))**2

for i in range(1,len(d)-1):
    x = int(d[i][0])
    y = int(d[i][1])
    s = int(d[i][2])
    M = 0
    for k in range(1,s-1):
        for l in range(1,s-1):
            a = int(k*(1+x/100))
            b = int(l*(1+x/100))
            if (a+b) == s:
                M_ = int(k*(1+y/100)) + int(l*(1+y/100)) 
                M = max(M,M_)
    print(M)

Submission status: Runtime Error

Solution code:

flg = 1

while flg > 0:
    inp = input().split()
    x = int(inp[0])
    y = int(inp[1])
    s = int(inp[2])

    flg = x**2+y**2+s**2
    if flg == 0:
        break

    M = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            a = int(i*(1+x/100))
            b = int(j*(1+x/100))
            if (a+b) == s:
                M_temp = int(i*(1+y/100)) + int(j*(1+y/100)) 
                M = max(M,M_temp)
    print(M)

Submission status: Runtime Error

Solution code:
Array = []
flg = 1

while flg > 0:
    inp = input().split()
    x = int(inp[0])
    y = int(inp[1])
    s = int(inp[2])

    flg = x**2+y**2+s**2
    if flg == 0:
        break

    M = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            a = int(i*(1+x/100))
            b = int(j*(1+x/100))
            if (a+b) == s:
                M_temp = int(i*(1+y/100)) + int(j*(1+y/100)) 
                M = max(M,M_temp)
    Array.append(M)

for k in range(0,len(Array)):
    print(Array[k])

Submission status: Runtime Error

Solution code:

Answer = []
flg = 1

def Taxed(p,q):
    T = int(p+p*q/100)
    return T

while flg > 0:
    inp = input().split()
    x = int(inp[0])
    y = int(inp[1])
    s = int(inp[2])

    flg = x**2+y**2+s**2
    if flg == 0:
        break

    M = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            a = Taxed(i,x)
            b = Taxed(j,x)
            if (a+b) == s:
                M_temp = Taxed(i,y) + Taxed(j,y) 
                M = max(M,M_temp)
    Answer.append(M)

for k in range(0,len(Answer)):
    print(Answer[k])

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

import sys
sys.setrecursionlimit(100000)

def MAX( a, b):
    return a if (a > b) else b

def tax_calcurate( tax, left, right):
    return left * (100 + tax) / 100 + right * (100 + tax) / 100

def Max_Search( left, right):

    global Max, search_cnt, p_tax, a_tax, price
    tmp = 0
    if left <= right :
        p_price = tax_calcurate(p_tax, left, right)
        if p_price == price : tmp = tax_calcurate( a_tax, left, right )
        Max = MAX( Max, tmp)

        if ( p_price == price and search_cnt <= price / 2) or ( p_price < price and search_cnt <= price / 2):
            Max_Search( search_cnt, price )
            search_cnt += 1
        else: Max_Search( left, right - 1)

while True:
    p_tax, a_tax, price = [int(i) for i in input().split()]
    global Max, search_cnt
    Max = search_cnt = 1

    if( p_tax == 0 and a_tax == 0 and price == 0 ): break
    Max_Search(search_cnt, price)
    print(Max)

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python

import sys
sys.setrecursionlimit(50000)

def MAX( a, b):
    return a if (a > b) else b

def tax_calcurate( tax, left, right):
    return left * (100 + tax) / 100 + right * (100 + tax) / 100

def Max_Search( left, right):

    global Max, search_cnt, p_tax, a_tax, price
    tmp = 0
    if left <= right :
        p_price = tax_calcurate(p_tax, left, right)
        if p_price == price : tmp = tax_calcurate( a_tax, left, right )
        Max = MAX( Max, tmp)

        if ( p_price == price and search_cnt <= price / 2) or ( p_price < price and search_cnt <= price / 2):
            Max_Search( search_cnt, price )
            search_cnt += 1
        else: Max_Search( left, right - 1)

while True:
    p_tax, a_tax, price = [int(i) for i in input().split()]
    global Max, search_cnt
    Max = search_cnt = 1

    if( p_tax == 0 and a_tax == 0 and price == 0 ): break
    Max_Search(search_cnt, price)
    print(Max)

Submission status: Runtime Error

Solution code:
while True:
    l = list(map(int, input().split()))
    if l[0] == 0 and l[1] == 0 and l[2] == 0:
        break
    ans = 0
    #  p (100+x) / 100
    loop = l[2] * (100 + l[0])/100
    for i in range(1, loop):
        for j in range(1, loop):
            tmp = i * (100 + l[0])/100 + j * (100 + l[0])/100
            if tmp == l[2]:
                tmp2 = i * (100 + l[1])/100 + j * (100 + l[1])/100
                if tmp2 > ans:
                    ans = tmp2

    print(ans)

Submission status: Runtime Error

Solution code:
while True:
    a,b,c = map(int, input().strip().split(' '))
    temp = 0
    if a == 0 and b == 0 and c == 0:
        break
    for i in range(1, 1001):
        for j in range(1, 1001):
            if i*(100+a)//100 + j*(100+a)//100 == c:
                if temp < i*(100+b)//100 + j*(100+b)//100:
                    temp = i*(100+b)//100 + j*(100+b)//100
    print(temp)

Submission status: Runtime Error

Solution code:
while True:
    a,b,c = map(int, input().strip().split(' '))
    temp = 0
    if a == 0 and b == 0 and c == 0:
        break
    for i in range(1, c):
        for j in range(1, c):
            if i*(100+a)//100 + j*(100+a)//100 == c:
                if temp < i*(100+b)//100 + j*(100+b)//100:
                    temp = i*(100+b)//100 + j*(100+b)//100
    print(temp)

Submission status: Runtime Error

Solution code:
while True:
    a,b,c = map(int, input().strip().split(' '))
    temp = 0
    if a == 0 and b == 0 and c == 0:
        break
    for i in range(1, c+1):
        for j in range(1, c+1):
            if i*(100+a)//100 + j*(100+a)//100 == c:
                if temp < i*(100+b)//100 + j*(100+b)//100:
                    temp = i*(100+b)//100 + j*(100+b)//100
    print(temp)

Submission status: Runtime Error

Solution code:
x,y,s=map(float,input().split())

while x!=0 or y!=0 or s!=0:
    x=1+x/100
    y=1+y/100
    s=int(s)
    maximum=0
    for i in range(s):
        for j in range(s):
            if int(i*x)+int(j*x)==s:
                maximum=max(maximum,int(i*y)+int(j*y))
    print(maximum)
    x,y,s=map(float,input().split())

Submission status: Runtime Error

Solution code:
x,y,s=map(int,input().split())

while x!=0 or y!=0 or s!=0:
    x_f=(100+x)/100.0
    y_f=(100+y)/100.0
    maximum=0
    for i in range(1,s):
        for j in range(i,s):
            if int(i*x_f)+int(j*x_f)==s:
                maximum=max(maximum,int(i*y_f)+int(j*y_f))
    print(maximum)
    x,y,s=map(int,input().split())

Submission status: Runtime Error

Solution code:
while True:
    x, y, s = map(int, raw_input().split())

    if x == 0 and y == 0 and s == 0:
        break

    ans = 0

    for i in range(1, s):
        for j in range(1, s):
            a = i * (100 + x) / 100;
            b = j * (100 + x) / 100;

            if a + b != s:
                continue

            ans = max(ans, i * (100 + y) / 100 + j * (100 + y) / 100)

    print ans

Submission status: Runtime Error

Solution code:
def tax(p,x):
def tax(p,x): 
   p*(100+x) // 100

def solve(x,y,s):
    suml = []
    for a in range(1,s):
        for b in range(1,s):
            sum1 = tax(a,x) + tax(b,x)
            if sum1 == s:
                sum2 = tax(a,y) + tax(b,y)
                suml.append(sum2)
            elif sum1 > s:
                break   ##b가 증가하면 s도 같이 증가하기때문. 처리속도 올려줌
        suml.sort()
    return suml[len(suml)-1]
    
while True:
    x,y,s = map(int, input().split())
    if (x,y,s == 0):
        break
    print(solve(x,y,s))

Submission status: Runtime Error

Solution code:
##결국 못풀어서 힌트봄
def tax(p,x):
    p*(100+x) // 100

def solve(x,y,s):
    suml = []
    for a in range(1,s):
        for b in range(1,s):
            sum1 = tax(a,x) + tax(b,x)
            if (sum1 == s and sum1-1 =< tax(a,y) + tax(b,y)):
                sum2 = tax(a,y) + tax(b,y)
                suml.append(sum2)
            elif sum1 > s:
                break   ##b가 증가하면 s도 같이 증가하기때문. 처리속도 올려줌
        suml.sort()
    return suml[len(suml)-1]
    
while True:
    x,y,s = map(int, input().split())
    if (x,y,s == 0):
        break
    print(solve(x,y,s))

Submission status: Runtime Error

Solution code:
def tax(p, rate):
    return p*(100+rate)//100
x, y, s = map(int, input().split())
while(x != 0 or y != 0 or s != 0):
    sumy = []
    sum_bf = int(s/(100+x)*100)
    for i in range(sum_bf-2, sum_bf+3):
        for j in range(1,i):
            k = i-j
            if(tax(k, x) + tax(j, x) == s):
                sumy1 = tax(k, y) + tax(j, y)
                sumy.append(sumy1)
    sumy.sort()
    print(sumy[len(sumy-1)])