Sliding doors have varying prices based on the width of the doors. The different prices are as follows:
- 60 - 80 cm: ¤150
- 81 - 100 cm: ¤200
- 101 - 120 cm: ¤220
When buying a closet you would obviously want to minimize the cost, so your task is to find the width of the doors that minimizes the total cost based on the total width of the closet.
Rules:
- The total width will be taken as input
- All doors will have the same width
- Choose the smallest doors if two type of doors cost the same
- The widths are in centimeters, integers not decimals
- Round up decimals
- The price shall be returned as an integer (no need for the currency sign)
- The input and output formats are optional, but the order of the output must be:
Number of doors, Width, Price
. - Input will be in the range
[120 1000)
.
This is code golf. Shortest code in bytes win.
Examples:
Input: 156
Output: 2, 78, 300
Input: 331
Output: 3, 111, 660
Input: 420
Output: 4, 105, 880
201
is an interesting test case... \$\endgroup\$