Problem - Folding Block (Hand-Written) (15 points)
"Folding Blocks" is a puzzle game, in which you need to unfold the blocks in order to fill the whole space. When you unfold a block, the block is extended with the same size to the unfolding direction. You can play the 2D version of this game here: https://www.crazygames.com/game/folding-blocks-puzzle.
Here we play the puzzle on a 1D board, where the whole space can be viewed as a line illustrated below. If a 2-length block initially fills 3-4 positions, and now we unfold it to the right side, it will fill 3-6 positions of the board.
Now given the length of the board, denoted as N, and the initial status (each block's length and position), please decide whether this puzzle can be solved. Note tht the given position of the block is its leftmost side and a puzzle is solved once all positions are filled after unfolding without overlapping or out-of-board blocks.
Fig 1. You can unfold the block to the left or right, but you cannot overlap other blocks or make blocks out of board when unfolding.
Fig 2. There's an example puzzle and solution.
Assignment Writing Help
Engineering Assignment Services
Do My Assignment Help
Write My Essay Services