Company: Dell
Difficulty: medium
Fair Floor Allocation A city planner is laying out a row of N residential towers standing side by side, numbered 1 through N. The city has secured enough construction material to build a total of M floors across all of the towers combined, and tower number K has been chosen as the flagship building whose height should be pushed as high as possible. Every tower in the row must end up at least 1 floor tall, and to keep the skyline looking balanced, no tower may finish 2 or more floors shorter than either tower standing directly next to it. In short, the planner must decide how many floors go on each tower so that every tower gets at least one floor, the whole M floors are used up validly, and no tower ends up two or more floors behind either of its immediate neighbors. Input Format The first line contains a single integer T representing the number of test cases. The second line of input contains three integers N, M, and K, representing the number of towers, the total number of floors ava