In: Physics
First, you have to rebuild a new management structure. A leadership hierarchy of some kind seems good, but you want to make sure that the teams and leaders are reasonable. Write an efficient algorithm that will organize the department (i.e. determine for each person, who is their boss), under the following conditions, or report that it is impossible.
• Each person but one (the lab director) should have exactly one boss.
• Each boss should have at most k people reporting to them.
• You have the seniority records for each member of the team, and need to make sure that each boss has at least twice as many years of experience as each person reporting to them.