A company is arranged in a heirarchical structure, with a layer of workers at the bottom. Each worker is managed by a manager. Consequently, each manager is managed by another manager until there is a company "boss". Each manager is restricted to managing, at most,
x workers. For a company of size
y calculate the number of managers required (including the boss)
Function should take two inputs.
Eg non-golfed definition:
You can assume that the number of workers per manager will be greater than 1.
- A company with 0 workers needs 0 managers
- If the company has 4 workers, and each manager can manage 8 workers, then there is 1 manager.
- If the company has 4 workers, and each manager can manage 4 workers, then you need 1 manager
- If the company has 12 workers, and each manager can manage 8 workers, then there are 3 managers: