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>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<string>
#include<cstring>
#include<cstdlib>
#include<cctype>
#include<bitset>
#include<functional>
#include<climits>
using namespace std;
typedef pair<int,int>pii;
const int INF=1e9;
const int dx[]={0,-1,0,1},dy[]={-1,0,1,0};


int main(){
    int n;
    int w[6]={2,3,5,10,12,15};
    int v[6]={380,550,850,380*5*80/100,550*4*85/100,850*3*88/100};
    while(scanf("%d",&n),n){
        n/=100;
        int dp[51];fill_n(dp,51,1<<25);
        dp[0]=0;
        for(int i=1;i<=n;i++){
            for(int j=0;j<6;j++){
                if(i-w[j]<0)continue;
                dp[i]=min(dp[i],dp[i-w[j]]+v[j]);
            }
        }
        printf("%d\n",dp[n]);
    }
    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<<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 <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair
#define each(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define exist(s,e) ((s).find(e)!=(s).end())
#define range(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  range(i,0,n)
#define clr(a,b) memset((a), (b) ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

const double eps = 1e-10;
const double pi  = acos(-1.0);
const ll INF =1LL << 62;
const int inf =1 << 30;

int dp[51];

int w[6]={2,3,5,10,12,15};
int v[6]={380,550,850,1520,1870,2244};

int main(void){
	rep(i,51) dp[i]=inf;
	dp[0]=0;
	rep(i,6){
		rep(j,51)if(j+w[i]<=50)
			dp[j+w[i]]=min(dp[j+w[i]],dp[j]+v[i]);
	}
	int n;
	while(cin >> n,n){
		int ans=dp[n/100];
		cout << ans << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstring>
#include <map>
#include <algorithm>
#define fr first
#define sc second
#define INF (2 << 28)
using namespace std;

typedef pair<int,int> iP;
iP dat[3];

double dp[5001];

double rec(int sum){
  if(sum == 0) return 0;
  if(sum < 0) return INF;
  if(dp[sum]) return dp[sum];
  double ret = INF;

  ret = min(rec(sum - 200 * 5) + 380 * 5 * 0.8,ret);
  ret = min(rec(sum - 300 * 4) + 550 * 4 * 0.85,ret);
  ret = min(rec(sum - 500 * 3) + 850 * 3 * 0.88,ret);
  
  for(int i=0;i<3;i++)
    ret = min(rec(sum - dat[i].fr) + dat[i].sc,ret);
  

  return dp[sum] = ret;
}

int main(){
  int n;
  dat[0].fr = 200; dat[0].sc = 380;
  dat[1].fr = 300; dat[1].sc = 550;
  dat[2].fr = 500; dat[2].sc = 850;

  while(cin >> n,n){
    memset(dp,0,sizeof(dp));
    cout << rec(n) << endl;
  }
}

C++: #include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cstring>
#include<map>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
#define all(n) n.begin(),n.end()

const int MAXI = 8, MAXJ = 60, INF = (1 << 28) - 1;

int w[] = {2, 3, 5, 10, 12, 15};
int v[] = {380, 550, 850, 1520, 1870 , 2244};
//int v[] = {380, 550, 850, 380*5 * 8 /10, 550*4*85/100, 850*3*88/100};
int dp[MAXI][MAXJ];

int main()
{
    memset(dp, INF, sizeof(dp));
    rep(j,MAXJ) dp[0][j] = INF;
    rep(i,MAXI) dp[i][0] = 0;


    REP(6)for(int j = 1;j<51;j++)
    {
        if(j - w[i] >= 0)dp[i+1][j] = min(dp[i][j], dp[i + 1][j - w[i]] + v[i]);
        else dp[i+1][j] = dp[i][j];
    }
    //rep(i,7){ rep(j,51) cout<< dp[i][j] <<" " ; cout << endl;}

    int wei;
    while(cin >> wei && wei)cout << dp[6][wei / 100] << endl;

    
    return 0;
}

C++: #include<iostream>
#include<cstdlib>

using namespace std;

int main(void) {
	int in, price;

	while(true) {
		cin >> in;
		if(in == 0) { break; }
		price = 0;
		while(in > 0) {
			if(in == 1500 || abs(1500-in/2) <= abs(1000-in/2)) {
				price += 2244;
				in -= 1500;
			} else if(in == 1000 || abs(1000-in/2) >= abs(1200-in/2)) {
				price += 1520;
				in -= 1000;
			} else if(in == 1200 || abs(1200-in/2) <= abs(500-in/2)) {
				price += 1870;
				in -= 1200;
			} else if(in == 500 || abs(500-in/2) <= abs(300-in/2)) {
				price += 850;
				in -= 500;
			} else if(in == 300 || abs(300-in/2) <= abs(200-in/2)) {
				price += 550;
				in -= 300;
			} else {
				price += 380;
				in -= 200;
			}
		}
		cout << price << endl;
	}

	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <limits>
#include <cmath>
using namespace std;
int main(void) {
	int  table[6][2] = { {2,380},{3,550},{5,850 },{10,1520},{12,1870},{15,2244} };
	int dp[53],buf;
	fill(dp, dp+53, 0xfffffff);
	dp[0] = 0;
	for (int i = 0; i < 6; i++) {
		for (int j = 0; j < 51; j++) {
			if (j >= table[i][0]) {
				dp[j] = min(dp[j], dp[j - table[i][0]] + table[i][1]);
			}
		}
	}
	for (;;) {
		cin >> buf;
		if (buf == 0)return 0;
		cout << dp[buf/100] << endl;

	}
	
}