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: a=[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]
dp=[1<<20]*51
for i,j in a:
    dp[i]=j
    for k in range(51-i):
        if dp[k]!=1<<20 and dp[k+i]>dp[k]+j:
            dp[k+i]=dp[k]+j
while 1:
    n=int(input())
    if n==0:break
    print(dp[n//100])

Python: #!/usr/bin/env python
from __future__ import division, print_function
from sys import stdin, exit


def main(readline=stdin.readline):
    table = (0, 0, 330, 550, 760, 850, 1100, 1230, 1400, 1610, 1520,
             1950, 1870, 2070, 2250, 2370, 2620, 2720, 2920, 3100, 3040,
             3470, 3390, 3590, 3740, 3890, 4140, 4240, 4440, 4590, 4560,
             4990, 4910, 5110, 5260, 5410, 5660, 5760, 5960, 6110, 6080,
             6510, 6430, 6630, 6780, 6930, 7180, 7280, 7480, 7630, 7600)
    while 1:
        weight = int(readline())
        if not weight:
            exit()
        print(table[weight//100])


if __name__ == '__main__':
    main()

Python: while True:
    n = int(input())
    if n==0:
        break
    if n % 200 == 0:
        a = n / 200
    else :
        a = n / 200 + 1
    a = (380 * (a - a % 5)) * 0.8 + 380 * (a % 5)
    if n % 300 == 0:
        b = n / 300
    else :
        b = n / 300 + 1
    b = (550 * (b - b % 4)) * 0.85 + 550 * (b % 4)
    if n % 500 == 0:
        c = n / 500
    else :
        c = n / 500 + 1
    c = (850 * (c - c % 3)) * 0.88 + 850 * (c % 3)

    if a < b:
        if a < c:
            #print ('a')
            print (int(a))
        else :
            #print ('c')
            print (int(c))
    elif b < c:
        #print ('b')
        print (int(b))
    else :
        #print ('c')
        print (int(c))

Python: a=[1e4]*51
for i,j in[(2,380),(3,550),(5,850),(10,1520),(12,1870),(15,2244)]:
 a[i]=j
 for k in range(51-i):a[k+i]=min(a[k+i],a[k]+j)
for n in iter(input,'0'):print(a[int(n)//100])

Python: Soba = [[2,380],[3,550],[5,850],[10,1520],[12,1870],[15,2244]] #???,??????
while True:
    g = int(input())
    if g == 0:
        break
    g_g = int(g / 100)
    DP = [[10000 for j in range(g_g + 1)] for i in range(7)]
    for i in range(7):
        DP[i][0] = 0
    for i in range(7):
        for j in range(g_g + 1):
            if j - Soba[i - 1][0] + 1 >= 0: 
                DP[i][j] = min(DP[i-1][j],DP[i][j - Soba[i - 1][0]] + Soba[i - 1][1])
            else:
                DP[i][j] = DP[i - 1][j]
    print(DP[6][g_g])

Python: while True:
  n = int(input())
  if n == 0:
    break
  c = 10000
  for i in range(n//500+1):
    n1 = n - 500*i
    c1 = (850*3*0.88)*(i//3)+850*(i%3) 
    for j in range(n1//300+1):
      n2 = n1 - 300*j
      if n2 % 200 == 0:
        k = n2 // 200
        c2 = c1 + (550*4*0.85)*(j//4)+550*(j%4)+(380*5*0.8)*(k//5)+380*(k%5)
        if c2 <= c:
          c = c2
  print(int(c))

Python: from itertools import combinations_with_replacement
while True:
    price = int(input())
    if price == 0: break
    candidates = []
    for i in range(1, 25):
        tmp = list(combinations_with_replacement([200, 300, 500], i))
        for t in tmp:
            if sum(t) == price:
                candidates.append(t)
    ans = []
    for candidate in candidates:
        i=j=k=0
        for c in candidate:
            if c == 200:
                i += 1
            elif c == 300:
                j += 1
            else:
                k += 1
        m200, m300, m500 = divmod(i, 5)[1], divmod(j, 4)[1], divmod(k, 3)[1]
        ans.append(380*(i-m200)*0.8+380*m200 + 550*(j-m300)*0.85+550*m300 + 850*(k-m500)*0.88+850*m500)
    print(int(min(ans)))

Python: p1,p2,p3 = 380,550,850
q1,q2,q3 = 200,300,500
d1,d2,d3 = 5,4,3
r1,r2,r3 = 0.2,0.15,0.12
arr = []
for tot in range(500,5001,100):
    lst = 1000000000
    for i in range(0,int(tot/q1)+1):
        for j in range(0,int(tot/q2)+1):
            for k in range(0,int(tot/q3)+1):
                if i*q1+j*q2+k*q3 == tot:
                    tmp = i*p1+j*p2+k*p3 - int(i/d1)*d1*p1*r1 - int(j/d2)*d2*p2*r2 - int(k/d3)*d3*p3*r3
                    lst = min(tmp,lst)
    arr.append([tot,int(lst)])
dic = dict(arr)
while(True):
    n = int(input())
    if n == 0:
        break
    print(dic[n])