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: 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,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

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,y,s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    for i in range(1,s):
        if max < calc(i,x,y)+calc(s-i,x,y):
            max = calc(i,x,y)+calc(s-i,x,y)
    print max

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,y,s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    for i in range(1,s):
        res = calc(i,x,y) + calc(s-i,x,y)
        if max < res:
            max = res
    print max

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,y,s = map(int,raw_input().split())
    if x == 0 and y == 0 and s == 0:
        break
    for i in range(1,s):
        j = s-i
        res = calc(i,x,y) + calc(j,x,y)
        if max < res:
            max = res
    print max

Submission status: Accepted

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 + 1):
      if f(i, x) + f(j, x) == s:
        ans = max(ans, f(i, y) + f(j, y))

  print ans

Submission status: Accepted

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, 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: Accepted

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

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

Submission status: Accepted

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-1e-10
    y /= 100.0-1e-10

    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 s-1 < b) or tax(a,x) + tax(b,x) != s: continue
        ans = max(ans, tax(a,y) + tax(b,y))
    print ans

Submission status: Accepted

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):
		priceB = s - priceA
		tmp_priceA_free = priceA * 100 / (100 + x)
		tmp_priceB_free = priceB * 100 / (100 + x)
		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
		if priceA_free * (100+x) / 100 != priceA or priceB_free * (100+x) / 100 != priceB:
			continue
		max_sum_price = max(max_sum_price, priceA_free*(100+y)/100 + priceB_free*(100+y)/100)
	print max_sum_price

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
 
while True:
    x,y,s = map(int,raw_input().split(" "))
    if x == 0 and y == 0 and s == 0:
        break
    cost = 0
    for i in range(s*100//(100+x),s+1):
        for j in range(1,i//2+1):
            if (j*(100+x)//100) + ((i-j)*(100+x)//100) == s:
                cost = max(cost,(j*(100+y)//100 + (i-j)*(100+y)//100))
            else:
                continue
    print(cost)

Submission status: Accepted

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

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):
        ix = calRate(i, x)
        j = int((s - ix) * 100.0 / (100.0 + x))
        if j < 1 or j > s-1:
            continue
        while True:
            if calRate(i, x) + calRate(j, x) < s:
                j += 1
            else:
                break
        if calRate(i, x) + calRate(j, x) != s:
            continue
        ans = max(ans, calRate(i, y) + calRate(j, y))
    print ans

Submission status: Accepted

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-i + 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: Accepted

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//2 + 1):
        for j in range(1,s-i + 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: Accepted

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):
			t = tax(i, x) + tax(j, x)
			if t > s:
				break
			if (t) == s:
				r = max((tax(i, y) + tax(j, y)), r)
	print(r)

Submission status: Accepted

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

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

    if x == 0:
        break

    results = []

    for i in range(1, s):
        for j in range(1, s - i + 1):
            if tax(i, x) + tax(j, x) != s:
                continue
            results.append(tax(i, y) + tax(j, y))

    if len(results) == 0:
        print 0
    else:
        print max(results)

Submission status: Accepted

Solution code:
while True:
  x,y,s = map(int, raw_input().split())
  if x==y==s==0: break
  summax = 0
  for a in xrange(1, s):
    b = s-a
    basea = a*100/(100+x)
    if a*100%(100+x) != 0: basea += 1
    baseb = b*100/(100+x)
    if b*100%(100+x) != 0: baseb += 1
    if basea*(100+x)/100 != a or baseb*(100+x)/100 != b: continue
    summax = max(summax, basea*(100+y)/100+baseb*(100+y)/100)
  print summax

Submission status: Accepted

Solution code:
def t(a,b,x):return b*(100+x)//100+(a-b)*(100+x)//100

while 1:
    x,y,s=map(int,input().split())
    if x==0:break
    a=0
    for i in range(s*100//(100+x),s+1):
        for j in range(1,i//2+1):
            if t(i,j,x)!=s:pass
            else:a=max(a,t(i,j,y))
    print(a)

Submission status: Accepted

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

    print(maximum)

Submission status: Accepted

Solution code:
while 1:
    x, y, s = map(int, raw_input().split())
    if x == y == s == 0:
        break
    ans = 0
    def calc(p, x, y):
        res = 0
        for i in xrange(1, p+1):
            if int(i*(100+x)/100.) == p:
                res = max(res, int(i*(100+y)/100.))
        return res
    for i in xrange(1, s/2+1):
        ans = max(ans, calc(i, x, y)+calc(s-i, x, y))
    print ans

Submission status: Accepted

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


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

ans = 0
x, y, s = rli()
while(x != 0 or y != 0 or s != 0):
    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):
                ans = max(ans, tax(k, y) + tax(j, y))
    print(ans)
    ans = 0
    x, y, s = rli()

Submission status: Accepted

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: Accepted

Solution code:
import math

def include_tax(v,p):
    return v * (100+p) // 100

def exclude_tax(v,p):
    return int(math.ceil(v * 100.0 / (100+p)))

while True:
    x,y,s = map(int,input().split())
    if x == 0: break
    mx = 0
    for a1 in range(1,s):
        b1 = include_tax(a1,x)
        b2 = s - b1
        if b2 <= 0: continue
        a2 = exclude_tax(b2,x)
        if b2 != include_tax(a2,x): continue
        c1 = include_tax(a1,y)
        c2 = include_tax(a2,y)
        mx = max(mx, c1+c2)
    print(mx)

Submission status: Accepted

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(i, 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: Accepted

Solution code:
from time import time

def change(before_tax,after_tax,previous_price):
    #change z from taxrate x to taxrate y
    original_price = 0
    for i in range(1, previous_price+1):
        if i * (100 + before_tax) // 100 == previous_price:
            original_price = i
            break
        else:
            pass
    return original_price * (100 + after_tax) // 100

#l = []

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

Submission status: Accepted

Solution code:
def change(before_tax,after_tax,previous_price):
    original_price = 0
    for i in range(1, previous_price+1):
        if i * (100 + before_tax) // 100 == previous_price:
            original_price = i
            break
        else:
            pass
    return original_price * (100 + after_tax) // 100

ans_list = []

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

for x in ans_list:
    print(x)

Submission status: Accepted

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-i+1):
            if int(i * (100 + x) / 100.0) + int(j * (100 + x) / 100.0) == s:
                ans = max(ans, int(i * (100 + y) / 100.0) + int(j * (100 + y) / 100.0))

    print ans

Submission status: Accepted

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

    ans = 0
    for a in range(1, s):
        for b in range(1, a + 1):
            pre = a * (100 + x) // 100 + b * (100 + x) // 100
            if pre == s:
                now = a * (100 + y) // 100 + b * (100 + y) // 100
                ans = max(ans, now)
    print(ans)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**3
eps = 1.0 / 10**10
mod = 10**9+7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    rr = []

    def f(n,p):
        return n * (100+p) // 100

    while True:
        x,y,s = LI()
        if x == 0:
            break
        a = set()
        m = -1
        for i in range(1,s):
            for j in range(i,s):
                u = f(i,x) + f(j,x)
                if u > s:
                    break
                if u == s:
                    t = f(i,y) + f(j,y)
                    if m < t:
                        m = t
        rr.append(m)

    return '\n'.join(map(str, rr))


print(main())

Submission status: Accepted

Solution code:
c=lambda p,x:int(p*(100+x)/100)
def d(p,x):
  e=int(p*100/(100+x))
  for i in range(e,e+3):
    if int(i*(100+x)/100)==p:
      return i
  return 0

while 1:
  x,y,s=map(int,input().split())
  if not x and not y and not s:break
  m=([[c(d(i,x),y),c(d(s-i,x),y)] for i in range(1,s//2+1)])
  print(max(map(sum,m)))

Submission status: Accepted

Solution code:
a = list(map(int,input().split()))
su = 0

while sum(a) != 0:
	for i in range(1,a[2]):
		for j in range(i,a[2]):
			if ((i *(100+a[0]))//100+(j *(100+a[0]))//100==a[2]):
				su = max(su,(i *(100+a[1]))//100+(j*(100+a[1]))//100)
	print(su)
	su = 0
	a = list(map(int,input().split()))

Submission status: Accepted

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

Submission status: Accepted

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:
		break
	m = 0
	for i in range(1, s):
		for j in range(1, s):
			t = tax(i, x) + tax(j, x)
			if t > s:
				break
			if (t) == s:
				m = max(m, tax(i, y) + tax(j, y))
	print(m)

Submission status: Accepted

Solution code:
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,i+1):
            p=i*(100+x)//100+j*(100+x)//100
            if p==s:
                now=i*(100+y)//100+j*(100+y)//100
                ans=max(ans,now)
    print(ans)

Submission status: Accepted

Solution code:
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:

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

Submission status: Accepted

Solution code:
import math
while True:
    x,y,s = map(int,input().split())
    if x==0 and y==0 and s==0:
        break
    maxz = 0
    for i in range(1,s-1):
        for j in range(1,s-1):
            if i+j > s:
                break
            if math.floor(i*(100+x)/100) + math.floor(j*(100+x)/100) == s:
                z = math.floor(i*(100+y)/100) + math.floor(j*(100+y)/100)
                if maxz < z:
                    maxz = z
    print(maxz)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!

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

Submission status: Accepted

Solution code:
def calc_before(x, s) :
    ans = []
    for i in range(1, s) :
        i_tax = int(i + i*x/100) 
        for j in range(1, s) :
            j_tax = int(j + j*x/100)
            if i_tax + j_tax > s :
                break
            if i_tax + j_tax == s :
                ans.append([i, j])
    return ans

def calc_after(i, j, y) :
    ans = int(i + i*y/100) + int(j + j*y/100)
    return ans

while True :
    x, y, s = map(int, input().split())
    if x == 0 and y == 0 :
        break
    
    lst = calc_before(x, s)
    max_price = 0
    for i in range(len(lst)) :
        price = calc_after(lst[i][0], lst[i][1], y)
        max_price = max(price, max_price)
    print(max_price)

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:
while True:
    x,y,s=map(int,input().split())
    if x==y==s==0:
        break
    ans=0
    for p1 in range(1,s+1):
        for p2 in range(p1,s+1):
            if (p1+p2+(p1*x)//100+(p2*x)//100)==s:
                t=p1+p2+(p1*y)//100+(p2*y)//100
                if t>ans:
                    ans=t
    print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#a,b は消費税x%のときの値段
#p,qは税抜きの値段
#c,d は消費税y%のときの値段

while True:
    x,y,s=map(int,input().split())
    if x==y==s==0:
        break
    else:
        m=0
        for p in range(1,s):
            for q in range(1,p+1):
                a=p*(100+x)//100
                b=q*(100+x)//100
                l=a+b
                if l==s:
                    c=p*(100+y)//100
                    d=q*(100+y)//100
                    n=c+d
                    m=max(m,n)
    print(m)

Submission status: Accepted

Solution code:
while True:
    x,y,s = map(int, input().split())
    if x == 0 and y == 0 and s == 0:
        break
    else:
        maxtax1 = 0
        maxtax2 = 0
        i = 1
        for i in range(1,s):
            for j in range(i,s):
                if (j*(100 + x) // 100) + (i*(100 + x) // 100) == s:
                    check = (i * (100 + y)) // 100
                    check2 = (j * (100 + y)) // 100
                    if (check + check2) > (maxtax1 + maxtax2):
                        maxtax1 = ((i*(100 + y)) // 100)
                        maxtax2 = ((j*(100 + y)) // 100)
        print(maxtax1 + maxtax2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import math
while True:
    x,y,s=map(int,input().split())
    t=0
    if x==0 and y==0 and s==0:
        break
    else:
        for ix in range(1,s):
            jx=s-ix
            i=math.ceil(ix*100/(100+x))
            j=math.ceil(jx*100/(100+x))
            if ix==math.floor(i*(100+x)/100) and jx==math.floor(j*(100+x)/100):
                iy=math.floor(i*(100+y)/100)
                jy=math.floor(j*(100+y)/100)
                if iy+jy>t:
                    t=iy+jy
                    continue
            else:
                continue
        print(t)

Submission status: Accepted

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

Submission status: Accepted

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

  max=0
  for i in range(1,s):
      for j in range(i,s+1):
          mae=i*(100+x)//100+j*(100+x)//100
          if mae==s:
             ato=i*(100+y)//100+j*(100+y)//100
             if ato>max:
                max=ato
            
  print(max)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
while True:
    x, y, s = map(int , input().split())
    if x == 0 and y == 0 and s == 0:
        break
    else:
        l = []
        for i in range(1, s):
            for j in range(1, i + 1):
                p = i * (100 + x) // 100 + j * (100 + x) // 100
                if p == s:
                    l.append(i * (100 + y) // 100 + j * (100 + y) // 100)
        print(max(l))

Submission status: Accepted

Solution code:
import math
while True:
  max_price=0
  x,y,s=map(int,input().split())
  if x==y==s==0:
    break
  else:
    for i in range(1,s//2 + 1):
      p_1=math.floor(i*(100+x)/100) 
      z=s-p_1         
      ori_z=math.ceil(z*100/(100+x))
      if math.floor(ori_z *(100+x)/100)+p_1 ==s:
          neo_i=math.floor(i*(100+y)/100)
          neo_z=math.floor(ori_z*(100+y)/100)
          neo_sum=neo_i+neo_z
          if neo_sum > max_price:
            max_price=neo_sum
    print(max_price)

Submission status: Accepted

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: 
        break
    sm=0
    for i in range(1,s):
        for j in range(i,s):
            if tax(i,x)+tax(j,x)==s:
                if sm<tax(i,y)+tax(j,y):
                    sm=tax(i,y)+tax(j,y)
    print(sm)

Submission status: Accepted

Solution code:
while True:
    x,y,s=map(int,input().split())
    
    if x==0 and y==0 and s==0:
        break
    ans = []
    for i in range(1,s):
        for j in range(1,i+1):
            
            a = i * (100 + x) // 100 + j * (100 + x) // 100
        
            if a == s:
                b = i * (100 + y) // 100 + j * (100 + y) // 100
                ans.append(int(b))
    
    print(max(ans))

Submission status: Accepted

Solution code:
import math

while True:
    data = input().split()
    x,y,s = int(data[0]),int(data[1]),int(data[2])
    if x == 0 and y == 0 and s == 0: break
    b_tax = (100+x)/100
    a_tax = ((100+y)/100)
    eps = 0.000000001
    maxSumPrice = 0
    for p1 in range(1,s):
        for p2 in range(p1,s):
            sumPrice = math.floor(p1*b_tax + eps) + math.floor(p2*b_tax + eps)
            if sumPrice == s:
                sumPrice_aTaxin = math.floor(p1*a_tax + eps) + math.floor(p2*a_tax + eps)
                maxSumPrice = max(maxSumPrice,sumPrice_aTaxin)
    print(maxSumPrice)

Submission status: Accepted

Solution code:
# 税抜価格から税込価格を計算する関数
#
#  [引数]
#   zeinuki  : 税抜価格(整数)
#   zeiritsu : 税率(パーセント, 整数)
#  [返り値]
#   税込価格(整数)
def calcZeikomi(zeinuki, zeiritsu):
    return zeinuki + zeinuki * zeiritsu // 100

# 税込価格から税抜価格の最小値を探索する関数
#
# [考え方]
#  税抜価格の最小値は1から税込価格の間にあり、1から探索すれば最小値が求まる
# [引数]
#  zeikomi  : 税込価格(整数)
#  zeiritsu : 税率(パーセント, 整数)
# [返り値]
#  税抜価格の最小値(整数)。存在しない場合はNone。
def calcZeinukiMinimum(zeikomi, zeiritsu):
    for i in range(1, zeikomi + 1):
        if (calcZeikomi(i, zeiritsu) == zeikomi):
            return i
    return None

# 税込価格から税抜価格の最大値を探索する関数
#
# [考え方]
#  税抜価格の最大値は1から税込価格の間にあり、税込価格から探索すれば最大値が
#  求まる
# [引数]
#  zeikomi  : 税込価格(整数)
#  zeiritsu : 税率(パーセント, 整数)
# [返り値]
#  税抜価格の最大値(整数)。存在しない場合はNone。
def calcZeinukiMaximum(zeikomi, zeiritsu):
    for i in range(zeikomi, 0, -1):
        if (calcZeikomi(i, zeiritsu) == zeikomi):
            return i
    return None

# 改定価格の最大値を計算する関数
#
# [引数]
#  rate0  : 変更前の消費税率(整数)
#  rate1  : 変更後の消費税率(整数)
#  price0 : 消費税率変更前の価格(整数)
# [返り値]
#  消費税率変更後の価格(整数)。存在しなければNone。
def calcKaiteiMaximum(rate0, rate1, price0):
    zeinuki = calcZeinukiMaximum(price0, rate0)
    if (zeinuki == None):
        return None
    return calcZeikomi(zeinuki, rate1)

# 問題を解く関数
#
# [考え方]
#  2商品の合計価格が与えられるので、総当たり法を実施
# [引数]
#  x : 変更前の消費税率(パーセント, 整数)
#  y : 変更後の消費税率(パーセント, 整数)
#  s : 消費税率変更前の２商品の税込合計価格
def solve(x, y, s):
    res = 0
    for i in range(1, s):
        price1 = calcKaiteiMaximum(x, y, i)
        price2 = calcKaiteiMaximum(x, y, s - i)
        if (price1 == None or price2 == None):
            continue
        res = max(res, price1 + price2)
    return res

# メインルーチン
while (True):
    ary = input().split()
    x = int(ary[0])
    y = int(ary[1])
    s = int(ary[2])
    if (x == 0 and y == 0 and s == 0):
        break
    print(solve(x, y, s))