I coded this up. vct.ash (vcon test):

Code:

import <vcon.ash>;
if ( count( vcon_best_boozes ) == 0 ) {
calculate_best_boozes( vcon_mpa() );
}
consumable_diet diet = calculate_diet( vcon_best_boozes, 20 );
print( " " );
print( "vcon recommends the following 20-fullness diet:" );
print( " " );
foreach index, c in diet {
print( c.it + " (" + c.profit + " profit)" );
}
print( "Done!" );

where calculate_diet is:

Code:

consumable_diet calculate_diet( consumables_by_size candidates, int capacity )
{
consumable_diet concatenate( consumable_diet... diets )
{
consumable_diet combined;
foreach i, diet in diets {
foreach i, c in diet {
combined[ combined.count() ] = c;
}
}
return combined;
}
int profit( consumable_diet diet )
{
int meat = 0;
foreach i, c in diet {
meat += c.profit;
}
return meat;
}
void print_diet( consumable_diet diet )
{
foreach index, c in diet {
print( c.it + " (" + c.profit + " profit)" );
}
}
// An array of best diets from 1 to capacity
consumable_diet[ int ] diets;
// Preload it with the best consumables
for ( int i = 1; i <= capacity; i++ ) {
diets[ i ] = { candidates[ i ] };
}
foreach i, diet in diets {
print( "Best diet for size " + i );
print_diet( diet );
}
for ( int i = 1; i <= capacity; i++ ) {
for ( int j = 1; j < i; j++ ) {
consumable_diet combined = concatenate( diets[ j ], diets[ i - j ] );
if ( combined.profit() > diets[ i ].profit() ) {
diets[ i ] = combined;
}
}
}
foreach i, diet in diets {
print( "Best diet for size " + i + " (" + diet.profit() + " profit)" );
print_diet( diet );
}
return diets[ capacity ];
}

Yields (removing the output from calculate_best_boozes):

Code:

Best diet for size 1
elemental caipiroska (23926 profit)
Best diet for size 2
Sangria de Menthe (44180 profit)
Best diet for size 3
perfect mimosa (73038 profit)
Best diet for size 4
hacked gibson (81641 profit)
Best diet for size 5
none (0 profit)
Best diet for size 6
space wine (81543 profit)
Best diet for size 7
none (0 profit)
Best diet for size 8
none (0 profit)
Best diet for size 9
none (0 profit)
Best diet for size 10
none (0 profit)
Best diet for size 11
none (0 profit)
Best diet for size 12
none (0 profit)
Best diet for size 13
none (0 profit)
Best diet for size 14
none (0 profit)
Best diet for size 15
none (0 profit)
Best diet for size 16
none (0 profit)
Best diet for size 17
none (0 profit)
Best diet for size 18
none (0 profit)
Best diet for size 19
none (0 profit)
Best diet for size 20
none (0 profit)
Best diet for size 1 (23926 profit)
elemental caipiroska (23926 profit)
Best diet for size 2 (47852 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
Best diet for size 3 (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 4 (96964 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
Best diet for size 5 (120890 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
Best diet for size 6 (146076 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 7 (170002 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 8 (193928 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 9 (219114 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 10 (243040 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 11 (266966 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 12 (292152 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 13 (316078 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 14 (340004 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 15 (365190 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 16 (389116 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 17 (413042 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 18 (438228 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 19 (462154 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Best diet for size 20 (486080 profit)
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
vcon recommends the following 20-fullness diet:
elemental caipiroska (23926 profit)
elemental caipiroska (23926 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
perfect mimosa (73038 profit)
Done!

I'll remove the excess logging and will submit this and then try using it in VMF.