Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

const qA, qB, qC = 200, 300, 500
const pA, pB, pC = 380, 550, 850
const dA, dB, dC = 5, 4, 3

func main() {
	stdin := bufio.NewScanner(os.Stdin)
	for stdin.Scan() {
		q, _ := strconv.Atoi(stdin.Text())
		if q == 0 {
			break
		}

		// A 0袋から始める
		curPrice, newPrice := 0, 0
		// B
		for a := 0; a <= int(q/qA); a++ {
			for b := 0; b <= int((q-qA*a)/qB); b++ {
				// 残り
				rem := q - qA*a - qB*b
				if rem == 0 || ((rem > 0) && ((rem % qC) == 0)) {
					// ちょうど買える
					newPrice = amount(a, b, int(rem/qC))
					if curPrice == 0 || newPrice < curPrice {
						// println(a, b, int(rem/qC), newPrice)
						curPrice = newPrice
					}
				}
			}
		}
		fmt.Println(curPrice)
	}
}

func amount(a, b, c int) int {
	tA := int(float64(int(a/dA)*dA*pA)*0.8) + (a%dA)*pA
	tB := int(float64(int(b/dB)*dB*pB)*0.85) + (b%dB)*pB
	tC := int(float64(int(c/dC)*dC*pC)*0.88) + (c%dC)*pC
	// println("amount:", a, b, c, tA, tB, tC, tA+tB+tC)
	return tA + tB + tC
}

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0106&lang=jp
"""
import sys


def solve(amount):
    """
    :param amount: ?????\???????????°?????????
    :return: ?????????
    """
    best_price = (amount + 199) // 200 * 380
    for a in range(amount // 200 + 1):
        for b in range(amount // 300 + 1):
            for c in range(amount // 500 + 1):
                for a1 in range(amount // 1000 + 1):
                    for b1 in range(amount // 1200 + 1):
                        for c1 in range(amount // 1500 + 1):
                            if a*200 + b*300 + c*500 + a1*1000 + b1*1200 + c1*1500 == amount:
                                price = a*380 + b*550 + c*850 + a1*1520 + b1*1870 + c1*2244
                                if price < best_price:
                                    best_price = price
    return best_price


def solve2(amount):
    """
    ???????¨???????????????¨?????????????????§???
    """
    packages = [(0, 0), (2, 380), (3, 550), (5, 850), (10, 1520), (12, 1870), (15, 2244)] # 1?¢??????????(100g??????)??¨??????????????¢l
    # dp??¨???2?¬??????????????¨?????????????(100g??????)?????????????????¨??§??????packages????¨????
    # 999999...??????INF??¨?????? (phthon 3.5??\??????????????????math.inf????????¨??§??????)
    cart = [[99999999] * (amount//100 + 1) for _ in range(len(packages))]
    for i in range(len(packages)):
        cart[i][0] = 0          #  0g???????????\????????´??????0???????????????

    for i in range(1, len(packages)):
        for j in range(1, len(cart[0])):
            w = packages[i][0]  #  ??????
            p = packages[i][1]  #  ??????
            if j < w:
                cart[i][j] = cart[i-1][j]
            else:
                # ???????????????????????????????????????????????????????????????????????????????¨????
                cart[i][j] = min(cart[i-1][j], cart[i-1][max(0, j-w)]+p, cart[i][max(0, j-w)]+p)
    return cart[-1][-1]


def main(args):
    while True:
        amount = int(input())
        if amount == 0:
            break
        #result = solve(amount)
        #print(result)
        result = solve2(amount)
        print(result)


if __name__ == '__main__':
    main(sys.argv[1:])

Python: P = [2, 10, 3, 12, 5, 15]
Q = [380, 1520, 550, 1870, 850, 2244]
L = 50
R = [0] + [1e9]*L
for p, q in zip(P, Q):
    for i in range(L-p+1):
        R[i+p] = min(R[i+p], R[i] + q)
while 1:
    v = int(input())
    if v == 0:
        break
    print(R[v//100])

Python: # -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0106&lang=jp
"""
import sys


def solve(amount):
    """
    :param amount: ?????\???????????°?????????
    :return: ?????????
    """
    best_price = (amount + 199) // 200 * 380
    for a in range(amount // 200 + 1):
        for b in range(amount // 300 + 1):
            for c in range(amount // 500 + 1):
                for a1 in range(amount // 1000 + 1):
                    for b1 in range(amount // 1200 + 1):
                        for c1 in range(amount // 1500 + 1):
                            if a*200 + b*300 + c*500 + a1*1000 + b1*1200 + c1*1500 == amount:
                                price = a*380 + b*550 + c*850 + a1*1520 + b1*1870 + c1*2244
                                if price < best_price:
                                    best_price = price
    return best_price




def main(args):
    while True:
        amount = int(input())
        if amount == 0:
            break
        result = solve(amount)
        print(result)



if __name__ == '__main__':
    main(sys.argv[1:])

Python: a=[2,3,5,10,12,15]
b=[380,550,850,1520,1870,2244]
while 1:
    n=int(input())
    if n==0:break
    n//=100
    dp=[0]+[1<<29]*n
    for i in range(5,-1,-1):
        for j in range(n+1):
            if j+a[i]<=n and dp[j]!=1<<29:dp[j+a[i]]=min(dp[j+a[i]],dp[j]+b[i])
    print(dp[n])

Python: def calc(A, B, C):
    da = A // 5
    na = A % 5
    db = B // 4
    nb = B % 4
    dc = C // 3
    nc = C % 3
    return da*1520 + na*380 + db*1870 + nb*550 + dc*2244 + nc*850

def f(a, b, c, g):
    if g == 0:
        return calc(a, b, c)
    if g < 0:
        return 10000000

    return min(f(a+1, b, c, g-2), f(a, b+1, c, g-3), f(a, b, c+1, g-5))

ans = [0,0,0,0,0,850,1100,1230,1400,1610,1520,\
       1950,1870,2070,2250,2244,2620,2624,2794,3004,3040,\
       3344,3390,3590,3740,3764,4120,4114,4314,4494,4488,\
       4864,4868,5038,5248,5284,5588,5634,5834,5984,6008,\
       6364,6358,6558,6738,6732,7108,7112,7282,7492,7528]

while True:
    N = int(input())
    if N == 0:
        break
    print(ans[N//100])

Python: import sys
#from me.io import dup_file_stdin

def price(pack,unit_price,units,off):
    return pack//units*units*unit_price*(1.-off) + pack%units*unit_price

#@dup_file_stdin
def solve():
    while True:
        w = int(sys.stdin.readline())
        if w == 0 :return
        min = max([380*25,550*17,850*10])
        for a in range(0,w//200+1):
            need = w - a*200 
            for b in range(0,need//300+1):
                if((need-b*300)%500!=0):continue
                c = (need-b*300)//500
                p = price(a,380,5,0.2)+price(b,550,4,0.15)+price(c,850,3,0.12)
                if p < min:
                    min = p
        print("{:.0f}".format(min))
solve()

Python: h={15:2244,12:1870,10:1520,5:850,3:550,2:380}
m={0:0}

for i in range(50):
  if i in m:
    for k,v in h.items():
      m[i+k] = min(m.get(i+k,1e9),m[i]+v)

while True:
  n = input()
  if n == 0 : break
  print(m[n/100])

Python: while 1:
    try:
        inp=int(input())
        if inp==0:break
        m_list=[]
        for i in range(4):
            for j in range(5):
                for k in range(6):
                    for l in range(3):
                        for m in range(4):
                            for n in range(5):
                                if i*1500+j*1200+k*1000+l*500+m*300+n*200==inp:
                                    m_list.append(i*2244+j*1870+k*1520+l*850+m*550+n*380)
        print(min(m_list))
    except:break