Go: package main

import "fmt"

func main() {
	maxGram := 5000
	// store := map[int]int{
	// 	1500: 2244, // 500 * 3
	// 	1200: 1870, // 300 * 4
	// 	1000: 1520, // 200 * 5
	// 	500:  850,
	// 	300:  550,
	// 	200:  380,
	// }

	for {
		var gram int
		fmt.Scanf("%d", &gram)

		if gram == 0 {
			return
		}

		var minPrice int

		// (x * 200) + (y * 300) + (z * 500) == gram
		for x := 0; (x * 200) <= maxGram; x++ {
			for y := 0; (y * 300) <= maxGram; y++ {
				for z := 0; (z * 500) <= maxGram; z++ {
					if (x*200)+(y*300)+(z*500) == gram {
						price := 0
						price += (z / 3) * 2244
						price += (z % 3) * 850
						price += (y / 4) * 1870
						price += (y % 4) * 550
						price += (x / 5) * 1520
						price += (x % 5) * 380

						if price < minPrice || minPrice == 0 {
							minPrice = price
						}
					}
				}
			}
		}

		fmt.Println(minPrice)
	}
}

// 1 袋あたりの量			200g	300g	500g
// 1 袋の単価(定価)		380円	550円	850円
// 割引が適用される単位		5袋毎	4袋毎	3袋毎
// 割引率							20%引き	15%引き	12%引き

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])