Job Scheduling
There are m jobs to schedule on n processors. A schedule is balanced if the difference between the number of jobs scheduled on any two neighboring processors does not exceed 1.
The kth processor is the most efficient, and thus, the maximum number of jobs should be scheduled on that processor. Find the maximum number of jobs that can be scheduled on the kth processor, such that the overall schedule remains balanced.
Note: Each processor must have at least one job scheduled.
Complete the function getMaximumJobs in the editor.
getMaximumJobs has the following parameters:
int n: the number of processorsint m: the number of jobsint k: the 1-based index of the most efficient processor
Returns
int: the maximum number of jobs that can be scheduled on the kth processor maintaining a balanced schedule
1Example 1
Given n = 5, m = 11, k = 5.
One optimal job schedule is [1, 1, 2, 3, 4].
2Example 2

Constraints
Limits and guarantees your solution can rely on.
1 ≤ n ≤ 105n ≤ m ≤ 1091 ≤ k ≤ n