• 36

## Learning Opportunities

This puzzle can be solved using the following concepts. Practice using these concepts and improve your skills.

## Goal

You are building a bookcase of a certain height and width, with a certain numberOfShelves:
â€¢ Except for the decorative top, you will use only the underline (_) and pipe (|) characters (and of course spaces) to do this.
â€¢ Divide the bookcase into as evenly distributed shelf-spaces as possible.
â€¢ If some have to be larger, put those below the others so they can hold the bigger heavier books.

NOTES:
â€¢ The decorative top of the bookcase (which is included in the height measurement) does not count as a shelf.
â€¢ The bottom of the bookcase does count as a shelf.
â€¢ For simplicity, assume a shelf itself doesn't take up any space.

The decorative top consists of / on the left side and \ on the right side, and a single ^ in the middle if needed.
Input
Line 1: integer height
Line 2: integer width
Line 3: integer numberOfShelves
Output
height lines, drawing the bookcase
Constraints
height,width â‰¥ 3
numberOfShelves â‰¥ 2
height > numberOfShelves
Example
Input
```8
13
3```
Output
```//////^\\\\\\
|           |
|___________|
|           |
|___________|
|           |
|           |
|___________|```

A higher resolution is required to access the IDE