PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""
New Job:
You've been hired by a house building company.
Their process is very simple.
In their buildings, all the rooms are the same cube.
They produce thousands of one model of square panel, and assemble them.
Same panels are used for ground, walls, ceiling.
Neighboring rooms share one same wall between them.
Adding doors, windows, anything else is left to the customer's pleasure.
Business is growing fast, so your help is needed:
The customer has only one variable to choose: 'n', the number of rooms.
For energy saving reasons, the surface of the house must be minimum for any given 'n'.
Multiple floors are possible.
You must write a code to find the number of panels that will be needed for a 'n' house.
examples:
n - pannels:
0 0
1 6
2 11
36 141
37 146
Bonus: make your code useful not only for today but also for the future of the company, by dealing with n dimensional houses.
"""
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run