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: Wrong Answer

Solution code:
while True:
    x, y, s = map(int, input().split())
    if x==0 and y==0 and s==0:
        break
    else:
        value = 0
        for a in range(1, int(s/2)+2):
            for b in range(int(s/2), s+1):
                if a + int(a*x/100) + b + int(b*x/100) == s:
                    value = max(value, a + int(a*y/100) + b + int(b*y/100))
        print(value)

Submission status: Wrong Answer

Solution code:
import math
while True:
    x, y, s = map(int, input().split())
    if x==0 and y==0 and s==0:
        break
    else:
        value = 0
        for a in range(1, int(s/2)+1):
            for b in range(int(s/2), s+1):
                if int(a*(100+x)/100) + int(b*(100+x)/100) == s:
                    value = max(value, int(a*(100+y)/100)+int(b*(100+y)/100))
        print(value)

Submission status: Wrong Answer

Solution code:
while True:
    x, y, s = map(int, input().split())
    if x==0 and y==0 and s==0:
        break
    else:
        value = 0
        for a in range(1, int(s/2)+1):
            for b in range(int(s/2), s):
                if int(a*(100+x)/100) + int(b*(100+x)/100) == s:
                    v = int(a*(100+y)/100) + int(b*(100+y)/100)
                    if value < v:
                        value = v
        print(value)

Submission status: Wrong Answer

Solution code:
def tax(p,x):
    return p*(100+x) // 100
def solve(X,Y,S):
    for a in range(1,S):
        for b in range(1,S-a+1):
            sum = tax(a,X)+tax(b,X)
            if sum == S:
                NS = tax(a,Y)+tax(b,Y)
                A=NS
            if sum > S:
                break
    return A 
while True:
    X,Y,S = map(int, input().split()) 
    if X == 0:
        break
    print(solve(X,Y,S))

Submission status: Wrong Answer

Solution code:
def tax(p,x):
    return p*(100+x) // 100
def solve(X,Y,S):
    A=0
    sum=0
    NS=0
    for a in range(1,S):
        for b in range(1,S-a+1):
            sum = tax(a,X)+tax(b,X)
            if sum == S:
                NS = tax(a,Y)+tax(b,Y)
                A = NS
            if sum > S:
                break
    return A 
while True:
    X,Y,S = map(int, input().split()) 
    if X == 0:
        break
    print(solve(X,Y,S))

Submission status: Wrong Answer

Solution code:

Submission status: Wrong Answer

Solution code:
import math


def calc(value, ratio):
    return math.floor(value * ratio)


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

    ret = 0

    x = 1 + x / 100
    y = 1 + y / 100

    for i in range(1, s):
        tmp = max(1, math.floor((s - calc(i, x)) / x))
        for j in range(tmp, s):
            if math.floor(i * x) + math.floor(j * x) != s:
                continue
            ret = max(ret, math.floor(i * y) + math.floor(j * y))

    print(ret)

Submission status: Wrong Answer

Solution code:
import math

def f(s, x):
  return int(math.floor(s * (100 + x) / 100.0))

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

  ans = 0
  for i in xrange(1, s):
    for j in xrange(1, s - i):
      if f(i, x) + f(j, x) == s:
        ans = max(ans, f(i, y) + f(j, y))

  print ans

Submission status: Wrong Answer

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

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        pass

    def solve(self):
        '''
        insert your code
        '''
        while True:
            x, y, s = map(int, raw_input().split())
            if x == 0 and y == 0 and s == 0:
                break
            before = [None] * 1001
            after = [None] * 1001
            for i in range(1, 1001):
                before[i] = i * (100 + x) / 100
                after[i] = i * (100 + y) / 100
            ans = -1
            for i in range(1, len(before)):
                for j in range(i+1, len(before)):
                    if before[i] + before[j] == s and ans < after[i] + after[j]:
                        ans = after[i] + after[j]
            
            # for a in range(1, 1001):
            #     b = 1001 - a
            #     if before[a] + before[b] == s and ans < after[a] + after[b]:
            #         ans = after[a] + after[b]
            print ans
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

Submission status: Wrong Answer

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

import os
import sys
import itertools
import math
from collections import Counter, defaultdict

class Main(object):
    
    def __init__(self):
        pass

    def solve(self):
        '''
        insert your code
        '''
        while True:
            x, y, s = map(int, raw_input().split())
            if x == 0 and y == 0 and s == 0:
                break
            before = [None] * 1001
            after = [None] * 1001
            for i in range(1, 1001):
                before[i] = i * (100 + x) / 100
                after[i] = i * (100 + y) / 100
            ans = -1
            for i in range(1, s):
                for j in range(i+1, s):
                    if before[i] + before[j] == s and ans < after[i] + after[j]:
                        ans = after[i] + after[j]
            
            # for a in range(1, 1001):
            #     b = 1001 - a
            #     if before[a] + before[b] == s and ans < after[a] + after[b]:
            #         ans = after[a] + after[b]
            print ans
        return None

if __name__ == '__main__':
    m = Main()
    m.solve()

Submission status: Wrong Answer

Solution code:
def tax(a,p):
    return int(a * (1.0 + p))
    
while 1:
    x,y,s = map(int,raw_input().split())
    if x == y == s == 0: break
    x /= 100.0
    y /= 100.0

    ans = 0
    for a in xrange(1,s):
        b = s - tax(a,x)
        while tax(a,x) + tax(b,x) > s: b -= 1
        if b < 1 or tax(a,x) + tax(b,x) != s: continue
        ans = max(ans, tax(a,y) + tax(b,y))
    print ans

Submission status: Wrong Answer

Solution code:
while 1 :
	x, y, s = map(int,raw_input().split(" "))
	if (x, y, s) == (0,0,0):
		break
	max_sum_price = 0
	for priceA in range(1, s / 2 + 1):
		priceA_free = priceA * 100 / (100 + x)
		priceB_free = (s - priceA) * 100 / (100 + x)
		tmp_priceA_free = priceA_free
		tmp_priceB_free = priceB_free
		while (tmp_priceA_free * (100+x) / 100 <= priceA):
			priceA_free = tmp_priceA_free
			tmp_priceA_free += 1
		while (tmp_priceB_free * (100+x) / 100 <= s - priceA):
			priceB_free = tmp_priceB_free
			tmp_priceB_free += 1
		max_sum_price = max(max_sum_price, priceA_free*(100+y)/100 + priceB_free*(100+y)/100)
	print max_sum_price

Submission status: Wrong Answer

Solution code:
def after_tax_price(x, p):
    return int(p*(100+x)/100)

def max_before_tax_price(x, after_tax_price):
    a = after_tax_price*100/(100+x)
    if int(a) == a:
        return a
    else:
        return a+1

while True:
    (x, y, s) = [int(x) for x in input().split()]
    if x==0 and y==0 and s==0:
        exit()
    max_price = 0
    for i in range(1, s//2+1):
        max_price = max(max_price, after_tax_price(y,max_before_tax_price(x,i))+after_tax_price(y,max_before_tax_price(x,s-i)))
    print(max_price)

Submission status: Wrong Answer

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):
        for j in range(1,s-i):
            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: Wrong Answer

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
    L = [0] * g(x, s)
    for i in range(g(x, s)):
        L[i] = g(x, i)
    for i in range(s):
        for j in range(s):
            if L[i] + L[j] == s:
                maximum = max(maximum, g(y, i) + g(y, j))
    print(maximum)

Submission status: Wrong Answer

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,int(s/2)+1):
        for j in range(s-(int(s*(100)/(100+x)))-1,s):
            if tax(i,x)+tax(j,x)==s:
                maximum=max(tax(i,y)+tax(j,y),maximum)

    print(maximum)

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    lst = []
    for i in range(int(s/2)):
        a = int(math.ceil((i+1)*1.0*100/(100+x))*(100+y)/100)
        b = int(math.ceil((s-i-1)*1.0*100/(100+x))*(100+y)/100)
        lst.append(a+b)
    print max(lst)

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x,y,s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            a = math.floor(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            b = math.floor(b) + 1
        list.append(math.floor(a*(100+y)/100)+math.floor(b*(100+y)/100))
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x,y,s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.floor(b*(100+y)/100))
        print a,b
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x,y,s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.floor(b*(100+y)/100))
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.floor(b*(100+y)/100))
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
# Hello World program in Python
import math
while 1:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    print math.trunc(max(list))

Submission status: Wrong Answer

Solution code:
import math
while 1:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    print int(math.trunc(max(list)))

Submission status: Wrong Answer

Solution code:
import math
while True:
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    print int(math.trunc(max(list)))

Submission status: Wrong Answer

Solution code:
while 1:
    import math
    x, y, s = map(int,raw_input().split())
    if x == y == s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    print int(math.trunc(max(list)))

Submission status: Wrong Answer

Solution code:
while 1:
    import math
    x, y, s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    list = []
    for i in range(1,s/2+1):
        a = i*1.0*100/(100+x)
        if isinstance(a,int) == False:
            if (math.trunc(a) + 1)*(100+x)/100 != i:
                a = 0
            else:
                a = math.trunc(a) + 1
        b = (s-i)*1.0*100/(100+x)
        if isinstance(b,int) == False:
            if (math.trunc(b) + 1)*(100+x)/100 != s-i:
                b = 0
            else:
                b = math.trunc(b) + 1
        list.append(math.trunc(a*(100+y)/100)+math.trunc(b*(100+y)/100))
    z = int(math.trunc(max(list)))
    print z

Submission status: Wrong Answer

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-t1+1):
                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: Wrong Answer

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 j in range(1,s-1):
        p = int((j+1)*100/(100+x))
        q = int((s-j+1)*100/(100+x))
        M = max(M,int(p*(1+y/100))+int(q*(1+y/100)))
    print(M)

Submission status: Wrong Answer

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(s-k-10,s-k+10):
            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: Wrong Answer

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(s-k,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: Wrong Answer

Solution code:
while True:
    l = map(int, raw_input().split())
    if l[0] == 0 and l[1] == 0 and l[2] == 0:
        break
    ans = 0
    #  p (100+x) / 100
    for i in range(l[2]-1):
        for j in range(l[2]-1):
            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: Wrong Answer

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//2+1):
        for j in range(c//2-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: Wrong Answer

Solution code:
def change(before_tax,after_tax,previous_price):
    #change z from taxrate x to taxrate y
    tmp_original_price = previous_price * 100 / (100 + before_tax)
    if tmp_original_price % 1 == 0:
        original_price = tmp_original_price
    else:
        original_price = tmp_original_price // 1 + 1
    return int(original_price * (100 + after_tax) // 100)


while True:
    x,y,s = [int(x) for x in input().split()]
    if x == 0:
        break
    else:
        ans = 0
        for i in range(1,int(s//2)+2):
            price1, price2 = i, s - i
            afterprice = change(x,y,price1) + change(x,y,price2)
            if afterprice > ans:
                ans = afterprice
            else:
                pass
        print(ans)

Submission status: Wrong Answer

Solution code:
##결국 못풀어서 힌트봄
def tax(p,x):
    return int(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: Time Limit Exceeded

Solution code:
def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    newsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            print(oldsum,a,b)
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    print(ans)

while True:
    a,b,c = map(int, input().split())
    if a == 0:
        break
    solve(a,b,c)

Submission status: Time Limit Exceeded

Solution code:
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        for j in range(1,s):
            if floor(i*(1+0.01*x))+floor(j*(1+0.01*x))==s:
                ans=max(ans,floor(i*(1+0.01*y))+floor(j*(1+0.01*y)))
    print(ans)

Submission status: Time Limit Exceeded

Solution code:
import math

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

    ret = 0

    x = 1 + x / 100
    y = 1 + y / 100

    for i in range(1, s):
        for j in range(1, s):
            if math.floor(i * x) + math.floor(j * x) != s:
                continue
            ret = max(ret, math.floor(i * y) + math.floor(j * y))

    print(ret)

Submission status: Accepted

Solution code:
# AOJ 1192: Tax Rate Changed
# Python3 2018.7.14 bal4u

while True:
	x, y, s = map(int, input().split())
	if x == 0: break
	ans = 0
	for p1 in range(1, s+1):
		for p2 in range(p1, s+1):
			t = p1 + p2 + (p1*x)//100 + (p2*x)//100
			if t > s: break
			if t != s: continue
			t = p1 + p2 + (p1*y)//100 + (p2*y)//100
			if t > ans: ans = t
	print(ans)

Submission status: Accepted

Solution code:
def tax(n,r):
    return n*(100+r)//100

while True:
    x,y,s = map(int,input().strip().split(" "))
    if [x,y,s] == [0,0,0]:   #ｘは変更前税率、ｙは変更後税率、ｓは変更前税込み合計
        break
    S = []
    M = 0
    for i in range(1,s//2+1):
        for j in range(1,s-i+1):
            if  tax(i,x) + tax(j,x) == s:
                t = tax(i,y) + tax(j,y)
                if t > M:
                    M = t
    print(M)

Submission status: Accepted

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

def solve(X,Y,S):
    best = 0
    for a in range(1,S):
        for b in range(1,S):
            sum = tax(a,X) + tax(b,X)
            if sum == S:
                tmp = tax(a,Y) + tax(b,Y)
                if tmp > best:
                    best = tmp
            if sum > S:
                break
    return best

while True:
    X,Y,S = map(int, input().strip().split(' '))
    if X == 0:
        break
    print(solve(X,Y,S))

Submission status: Accepted

Solution code:
def tax(p,x):
    return p*(100+x) // 100 # 整数除算

def solve(X,Y,S):
    ans = 0
    oldsum = 0
    newsum = 0
    for a in range(1,S):
        for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
            oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
            if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討 
                newsum = tax(a,Y)+tax(b,Y) 
                if newsum > ans:
                    ans =newsum
            if oldsum > S:
                break # b増加ならばsum増加のため
    return ans

while True:
    X,Y,S = map(int, input().split())
    if X == 0:
        break
    print(solve(X,Y,S))

Submission status: Accepted

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

def solve(X,Y,S):
    A=0
    sum=0
    NS=0
    for a in range(1,S):
        for b in range(1,S-a+1):
            sum = tax(a,X)+tax(b,X)
            if sum == S:
                NS = tax(a,Y)+tax(b,Y)
                if NS > A:
                    A = NS
            if sum > S:
                break
    return A 

while True:
    X,Y,S = map(int, input().split()) 
    if X == 0:
        break
    print(solve(X,Y,S))

Submission status: Accepted

Solution code:
def tax(p,x):
    return p*(100+x)//100
def solve(X, Y, S):
    max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
    for a in range(1,S):
        for b in range(1,S):
            sum_value=tax(a,X)+tax(b,X)
            if sum_value==S:
                c=tax(a,Y)+tax(b,Y)
                if c>max_value:#最初は>=にしてたのですが、> にすることで高速化を図れました
                    max_value=c
                if sum_value>S: #bが増加すれば必ずSが増加することを使っていて、なるほどと思いました。
                    break
    return max_value

while True:
    X,Y,Z=map(int, input().split())
    if X==0:
        break
    print(solve(X,Y,Z))
#runtime errorになりましたが、ジャッジングデータと結果が一致しました。制限時間内に解く方法がわかりませんでした。
#右・中央の座席

Submission status: Accepted

Solution code:
ans_list = []

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, 1000):
        if i * (100 + x) // 100 > s:
            break
        for j in range(1, 1000):
            if i * (100 + x) // 100 + j * (100 + x) // 100 == s:
                ans = max(ans, i * (100 + y) // 100 + j * (100 + y) // 100)
            elif i * (100 + x) // 100 + j * (100 + x) // 100 > s:
                break
    #print(ans)
    ans_list.append(ans)

for i in ans_list:
    print(i)

Submission status: Accepted

Solution code:
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        j=s-floor(i*(100+x)/100)
        if j<1:
            continue
        j=floor((j+1)*(100/(100+x)))
        for k in [j-1,j]:
            if floor(i*(100+x)/100)+floor(k*(100+x)/100)==s:
                ans=max(ans,floor(i*(100+y)/100)+floor(k*(100+y)/100))
    print(ans)

Submission status: Accepted

Solution code:
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,datetime
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

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


while True:
    x,y,s = inpl()
    if x == 0 and y == 0 and s == 0:
        break
    else:
        ans = 0
        for a in range(1,s):
            ap = calc(a,x)
            for b in range(1,s):
                bp = calc(b,x)
                if ap + bp != s:
                    continue
                else:
                    tmp = calc(a,y) + calc(b,y)
                    ans = max(ans,tmp)
        print(ans)

Submission status: Accepted

Solution code:
def calc(pp,x,y):
    p = 0
    for i in range(1,1000):
        if i*(100+x)/100 == pp:
            p = i
            break
    return p*(100+y)/100

while True:
    max = 0
    X = 0
    Y = 0
    x,y,s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    for i in range(1,s):
        for j in range(i,s):
            if i + j != s:
                continue
            if max < calc(i,x,y)+calc(j,x,y):
                max = calc(i,x,y)+calc(j,x,y)
    print max