A monitoring room watches N sensors over T time slots. At each slot you can listen to at most M sensors in parallel (think of M radio buckets). If you listen to a sensor at slot t, that sensor must rest for the next D slots and cannot be listened to again until slot t - D + 1.
For each slot and sensor i, you are given a non-negative score S[t][i] which is the value if you listen to sensor i at time t. For every fixed sensor i, its scores are non-increasing over time: S[1][i] ≥ S[2][i] ≥ ... ≥ S[T][i]. Choose which sensors to listen to in each slot (up to M per slot) to maximize the total score.
Implement the function maxPingScore which takes the parameters below and returns the maximum total score as a 64-bit integer.
Function Parameters
Return