-__DATA__
-
-# if (defined $price{Swill}) {
-# map { $price{$_}= undef if $price{$_} eq 'x' } @rums;
-# }
-# if (defined $have{Swill}) {
-# $have_proof= 0;
-# map { $have_proof += $have{$_} * $proof{$_} } @rums;
-# }
-
-our ($best);
-
-our $have_proof;
-
-our ($need_proof, %need, %buy);
-
-
-sub compute_restock_cheapest_rum() {
- my %bill;
- map {
- $bill{$_} = $buy{$_} * $price{$_} if defined $price{$_};
- } @rums;
- prf('nominal bill', %bill, 'poe');
- print "\n";
- if ($need_proof < 0) {
- printf "stocks are sufficient";
- } else {
- my $buy= ceil($buy{$best});
- printf "buy %d %s at %d poe each for %d poe",
- $buy, $best, $price{$best}, $buy * $price{$best};
- }
- print "\n\n";
-}
-
-main();