Week 4 Contest | ASHIGIFT | Failing only Subtask 1 Task 1 |

Submission

Approach : First I sort all the dishes and clan locations according to their distances. Then it’s just a matter of finding lowest possible answer with binary search. Since, all locations are sorted by distances, we can simply iterate over all the stops with the condition that count of people at any point is positive.