Syntactic Confectionery Delight PerlMonks

### comment on

 Need Help??

Someone posted this challenge at work..
The country of Elbonia is standardizing its postal system to streamline its parcel service. All parcel boxes (many sizes available) now come with 10 preprinted rectangles on one side for stamps to be stuck into. Elbonia's stamp denominations are:
1c, 2c, 3c, 4c, 5c, 10c, 24c, 37c, 39c, 41c, 48c, 60c, 63c, 70c, 75c, 80c, 83c, 84c, 87c, \$1, \$3.85, \$4.05, \$4.60, \$5, \$14.40
Given an infinite supply of each denomination, what is the minimum postage amount that would REQUIRE 11 stamps and so not work with the streamlined service?

```my\$w={0=>1,1=>1,2=>2,3=>3,4=>4,5=>5,10=>
10,24=>24,37=>37,39=>39,41=>41,48=>48,60
=>60                               ,63=>
63,                70=>            70,75
=>75               ,80=>80         ,83=>
83,            84=>84,87=>87,      100=>
100,          385=>385,405=>405   ,460=>
460           ,500=>500,1440=>    1440};
my@a          =sort{\$a<=>\$b}keys  %{\$w};
for(          1..9){foreach my\$c  (keys
%{\$w}        ){foreach my \$v(@a)  {my \$n
=\$c+        \$v;if(!exists\$w->     {\$n})
{\$w          ->{\$n}=\$w->{\$c}.     "+".\$v
;}}}         }my@r=sort{\$a<=>    \$b}keys
%{\$w          };my\$h=pop@r;     for my\$i
(0..          \$h){if(exists       \$w->{\$
i}){              print"\$          i->".
\$w->              {\$i}."\n"        ;}###
else{              print"!\$i       \n";}
}###    #         ##########       #####
####    #        ############      #####
####    #       ##############     #####
####    #     ################     #####
####        ###################    #####
####         ##############        #####
####                               ## ##
########################################
##### # ########### ############## #####
########################################

In reply to Stamp puzzle solution by drpaz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

• Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
• Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
• Read Where should I post X? if you're not absolutely sure you're posting in the right place.
• Posts may use any of the Perl Monks Approved HTML tags:
a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
• You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
 For: Use: & & < < > > [ [ ] ]
• Link using PerlMonks shortcuts! What shortcuts can I use for linking?

Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (8)
As of 2021-04-23 14:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?

No recent polls found

Notices?