You may be able to convince yourself, but I'm convinced that you're wrong about that decomposition being possible. Let me try to convince you.
Consider the case where you have blocks with width/thickness pairs of 4,3, 1,5 and 3,2. They can be arranged into the following pattern to form a 5,8 square:
_______ _
| | |
| | |
|_______| |
| | | |
| |_____|_|
| | |
| | |
|_|_______|
(I've actually drawn each horizontal space as 2 characters...)
I assert that that example can't be broken down as you claimed it could. A brute force proof is fairly straightforward. You have to put some block in the top left corner. Let's examine each possibility.
- Top left is a 4,3 block. Then going clockwise looking at width and depth it is easy to show you need a 1,5, then a 4,3, then a 1,5 leaving the 3,2 hole in the middle. (This is the diagram above.)
- Top left is a 1,5 block. Going counter-clockwise it is easy to see that you need a 4,3 then 1,5 then 4,3 leaving a 3,2 hole in the middle. (This is the mirror image of the diagram above.)
- Top left is a 3,2 block. Going clockwise we need it 2 wider, so we have to add 2 1,5s. To add 3 to the depth below them you need a 4,3, and then to the left of that we have to add 1 more width so we need a 1,5 that unfortunately intersects our original 3,2 block. This case is therefore impossible.
So you see that by brute force there are 2 ways to solve this problem, and neither decomposes as you'd hoped.
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.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, 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, summary, 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?
See Writeup Formatting Tips and other pages linked from there for more info.