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
}

C++: #include<iostream>

using namespace std;

int main(void){
	std::ios_base::sync_with_stdio();

	int n;
	int dp[51];
	bool f;

	while(1){
		cin>>n;
		if(n==0) break;
		for(int i=0;i<51;i++) dp[i]=-1;
		dp[n/100]=0;
		f=true;
		while(f){
			f=false;
			for(int i=n/100;i>=0;i--){
				if(dp[i]!=-1){
					/*A5*/
					if(i>=10){
						if(dp[i-10]==-1||dp[i-10]>dp[i]+(380*5)*0.8){
							f=true;
							dp[i-10]=dp[i]+(380*5)*0.8;
						}
					}
					/*B5*/
					if(i>=12){
						if(dp[i-12]==-1||dp[i-12]>dp[i]+(550*4)*0.85){
							f=true;
							dp[i-12]=dp[i]+(550*4)*0.85;
						}
					}
					/*C5*/
					if(i>=15){
						if(dp[i-15]==-1||dp[i-15]>dp[i]+(850*3)*0.88){
							f=true;
							dp[i-15]=dp[i]+(850*3)*0.88;
						}
					}
					/*A1*/
					if(i>=2){
						if(dp[i-2]==-1||dp[i-2]>dp[i]+380){
							f=true;
							dp[i-2]=dp[i]+380;
						}
					}
					/*B1*/
					if(i>=3){
						if(dp[i-3]==-1||dp[i-3]>dp[i]+550){
							f=true;
							dp[i-3]=dp[i]+550;
						}
					}
					/*C1*/
					if(i>=5){
						if(dp[i-5]==-1||dp[i-5]>dp[i]+850){
							f=true;
							dp[i-5]=dp[i]+850;
						}
					}
				}
			}
		}
		cout<<dp[0]<<endl;
	}
	return 0;
}

C++: #include <iostream>
#define INF 1000000000

using namespace std;

main(){
  int items[]={200, 300, 500, 1000, 1200, 1500};
  int price[]={380, 550, 850, 1520, 1870, 2244};
  int dp[5001];
  for(int i=0;i<=5000;i++){
    dp[i]=INF;
  }
  dp[0]=0;
  for(int i=0;i<6;i++){
    for(int j=0;j+items[i]<=5000;j++){
      dp[j+items[i]]=min(dp[j+items[i]], dp[j]+price[i]);
    }
  }
  int n;
  while(1){
    cin >> n;
    if(n==0) break;
    cout << dp[n] << endl;
  }
  return 0;
}

C++: #include<iostream>
#include<algorithm>
#include<float.h>
using namespace std;
typedef struct{
  double ryou;
  int tanka;
  int warimai;
  double wariritu;
}MISE;
MISE mise[3];
double mokuhyou;
double mem[3][100];
double shop(int now,double ryou,double money);
main(){
 mise[0].ryou=2;
 mise[1].ryou=3;
 mise[2].ryou=5;
 mise[0].tanka=380;
 mise[1].tanka=550;
 mise[2].tanka=850;
 mise[0].warimai=5;
 mise[1].warimai=4;
 mise[2].warimai=3;
 mise[0].wariritu=0.8;
 mise[1].wariritu=0.85;
 mise[2].wariritu=0.88;
 while(1){
   for(int i=0;i<3;i++){
     for(int j=0;j<100;j++){
       mem[i][j]=0.0;
     }
   }
   cin>>mokuhyou;
   if(mokuhyou==0)break;
   cout<<(int)shop(0,0.0,0.0)<<endl;
 }
}
double shop(int now,double ryou,double money){
  if(now==3&&ryou*100==mokuhyou){
    return mem[now][(int)ryou/100]=money;
  }
  else if(now==3){
    return DBL_MAX;
  }
  else if(mem[now][(int)ryou]!=0){
    return mem[now][(int)ryou];
  }
  else{
    double mins=DBL_MAX;
    int a=0;
    double before=0;
    mins=min(mins,shop(now+1,ryou,money+before));
    while(ryou*100<=mokuhyou){
      a++;
      ryou+=mise[now].ryou;
      if(a%mise[now].warimai==0){
	before=a*mise[now].tanka*mise[now].wariritu;
      }
      else{
	int aa=a/mise[now].warimai*mise[now].warimai;
	before=aa*mise[now].tanka*mise[now].wariritu+(a-aa)*mise[now].tanka;
      }
      mins=min(mins,shop(now+1,ryou,money+before));
    }
    return mem[now][(int)ryou]=mins;
  }
  return -1;
}

C++: #include <iostream>

using namespace std;

int p[6] = { 380 , 550 , 850 , 1520 , 1870 , 2244};
int w[6] = { 200 , 300 , 500 , 1000 , 1200 , 1500};

int dp[5001];
const int INF = 1000000;

int main(void){
  int W;
  fill(dp , dp+5001 , INF);
  dp[0] = 0;

  for(int i=0; i<=5000; i++){
    for(int j=0; j<6; j++){
      for(int k=max(0,i-w[j]); k<i; k++){
        dp[i] = min(dp[k] + p[j] , dp[i]);
      }
    }
  }  
  
  while(cin >> W, W){
    cout << dp[W] << endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;

int main() {
  int n;
  int a[3] = {2, 3, 5};
  int b[3] = {380, 550, 850};
  int c[3] = {5, 4, 3};
  int d[3] = {20, 15, 12};
  int e[3];
  int z[51] = {0};
  int f, g, h, s;

  for (int i=0; i<3; i++) {
    e[i] = b[i] * c[i] * (100 - d[i]) / 100;
  }

  for (int i=0; i<3; i++) {
    for (int j=0; j<=50; j++) {
      if (j && !z[j]) continue;
      int k=1;
      while (1) {
        f = j+k*a[i];
        if (f>50) break;
        g = k / c[i];
        h = k - g*c[i];
        s = z[j] + g*e[i] + h*b[i];
        if (!z[f] || s<z[f]) z[f] = s;
        k++;
      }
    }
  }

  //for (int i=6; i<=50; i++) {
  //  for (int j=i-1; j>=5; j--) {
  //    if (z[j]<=z[i]) break;
  //    z[j] = z[i];
  //  }
  //}

  while (cin >> n && n) {
    cout << z[n/100] << endl;
  }

  return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
#include <complex>
#include <utility>
#include <numeric>
#define  rep(i,n) for(int i=0;i<(n);i++)
#define  REP(i,a,n) for(int i=a;i<(n);i++)
#define  rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define  VI	vector<int>
#define	 VS vector<string>
#define  all(a) (a).begin(),(a).end()
#define  debug(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef long long ll;

const int INF=1000000;
char fi[101][101];
int d[21][21];
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
double EPS = 1e-10;
int N,M;
int sx,sy;
int gx,gy;
int w,h;
int ans;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int MAX_V=100;
const int MAX_N=100;
char o[3]={'+','-','*'};
#define md 1000003


int dp[353][353]={0};
int bow[353][353]={0};
double add(double a,double b){
	if(abs(a+b)<EPS*(abs(a)+abs(b)))
	return 0;
	return a+b;
}

struct P{
	double x,y;
	P(){}
		P(double x,double y):x(x),y(y){
		}
		P operator + (P p){
			return P(add(x,p.x),add(y,p.y));
		}
		P operator - (P p){
			return P(add(x,-p.x),add(y,-p.y));
		}
		P operator *(double d){
			return P(x*d,y*d);
		}
		double dot(P p){
			return add(x*p.x,y*p.y);
		}
		double det(P p){
			return add(x*p.y,-y*p.x);
		}
};

bool cmp_x(const P& p,const P& q){
	if(p.x!=q.x) return p.x<q.x;
	return p.y<q.y;
}

vector<P> convex_hull(P* ps, int n){
	sort(ps,ps+n,cmp_x);
	int k=0;
	vector<P> 	qs(n*2);
	
	rep(i,n){
		while(k>1&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
			k--;
		qs[k++]=ps[i];
	}
	for(int i=n-2,t=k;i>=0;i--){
		while(k>t&&(qs[k-1]-qs[k-2]).det(ps[i]-qs[k-1])<=0)
		k--;
		qs[k++]=ps[i];
	}
	qs.resize(k-1);
	return qs;
}

int n;
P ps[101];

int main(){
	
	int n;
	while(cin>>n,n!=0){
		ll ans=1000000;
	for(int i=0;i<=50;i++){
		for(int j=0;j<=50;j++){
			for(int k=0;k<=50;k++){
				ll cho=380*((i/5)*5)*0.8+380*(i%5);
				cho+=550*((j/4)*4)*0.85+550*(j%4);
				cho+=850*((k/3)*3)*0.88+850*(k%3);
				if(i*200+j*300+k*500==n)
					ans=min(ans,cho);
			}
		}
	}
		cout<<ans<<endl;
	}

	
}