Not able to understand the solution

I am trying to solve this question…
https://codeforces.com/contest/1443/problem/C
Although i have solved it using binary search…
But i am trying to understand the solution of this guy.
https://codeforces.com/contest/1443/submission/97451223
Can you explain a bit… what he is doing exactly.

hello @ashishnnnnn
he is applying greedy here. i,e he is visiting those shops whose courier time is high.
so what he did is he sorted on the basis of courier time (in ascending order) and then for each i and he is using courier service for [0…i] (becuase they have minimum courier time compared to [i+1…n-1] ) and for remaining [i+1…n-1] he is going himself .