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 <algorithm>
#include <cstdlib>
#include <climits>
using namespace std;

enum stats_detail {
  WEIGHT = 0,
  PRICE  = 1,
  UNIT   = 2,
  RATE   = 3
};

enum shop {
  A = 0,
  B = 1,
  C = 2
};

const static int shop_stats[ 3 ][ 4 ] = {
  { 200, 380, 5, 20 },
  { 300, 550, 4, 15 },
  { 500, 850, 3, 12 }
};

const static int W_MAX = 5000;
const static int W_UNIT = 100;
const static int OPT_ARRAY_SIZE = W_MAX / W_UNIT + 1;

int get_price( shop id, int num ) {
  
  int discount_num = num - num % shop_stats[ id ][ UNIT ];
  return (
      shop_stats[ id ][ PRICE ] *
      discount_num *
      ( 100 - shop_stats[ id ][ RATE ] ) / 100  +
      shop_stats[ id ][ PRICE ] * ( num - discount_num )
 );
 
  return 0;
}
int main() {
  int opt[ OPT_ARRAY_SIZE ];
  fill( opt, opt + OPT_ARRAY_SIZE, INT_MAX );
  for( int i = 0; i <= W_MAX / shop_stats[ A ][ WEIGHT ]; i++ ) {
    int apr = get_price( A, i );
    int aw  = i * shop_stats[ A ][ WEIGHT ];
    for( int j = 0; j <= W_MAX / shop_stats[ B ][ WEIGHT ]; j++ ) {
      int bpr = get_price( B, j );
      int bw  = j * shop_stats[ B ][ WEIGHT ];
      for( int k = 0; k <= W_MAX / shop_stats[ C ][ WEIGHT ]; k++ ) {
        int cpr = get_price( C, k );
        int cw  = k * shop_stats[ C ][ WEIGHT ];
        int sumw = aw + bw + cw;
        if( sumw > W_MAX ) { continue; }
        opt[ sumw / W_UNIT ] = min( opt[ sumw / W_UNIT ], apr + bpr + cpr );
      }
    }
  } 
  while( 1 ) {
    int w;
    cin >> w;
    if( !w ) { break; }
    cout << opt[ w / W_UNIT ] << endl;
  }
  return EXIT_SUCCESS;
}

C++: # define _CRT_SECURE_NO_WARNINGS 1
# include <iostream>
# include <string>
# include <vector>
# include <algorithm>
# include <cstdlib>
# include <cstdio>
# include <cstring>
# include <cstdlib>
# include <iomanip>
# include <queue>
# include <sstream>
# include <climits>
# include <cmath>
# include <list>
# include <functional>
# include <set>
# include <map>
# include <stack>
using namespace std;
# define M_PI 3.141592
# define FOR(i,n) for(int i=0;i<(int)n;i++)
# define FORI(i,k,n) for(int i=k;i<(int)n;i++)
# define toRad 2.0*M_PI/360.0
# define inin(x) int x;cin>>x;
# define all(x) x.begin(),x.end()
# define debug(x) cout<<#x<<" :"<<x<<endl;
# define rep(i,n) for(int i=0;i<(int)n;i++)
# define EPS 1e-12
# define pri_max 60000
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;


int main()
{
	int v;
	while (cin >> v&&v)
	{
		int ans = INT_MAX;
		for (int a = 0;a<=30; a++)
		{
			for (int b = 0;b<=30; b++)
			{
				for (int c = 0; c <= 30; c++)
				{
					if (a * 200 + b * 300 + c * 500 == v)
					{
						int temp = a * 380 + b * 550 + c * 850;
						temp -= (a / 5) * 5 * (380 * 0.2);
						temp -= (b / 4) * 4 * (550 * 0.15);
						temp -= (c / 3) * 3 * (850 * 0.12);
						ans = min(ans, temp);
					}
				}
			}
		}
		cout << ans << endl;
	}
}