A mountain-climbing camp on the Taihang Mountains offers visitors two kinds of activities: a leisure sightseeing route and a challenging climbing route. The camp sets a fitness threshold: when a person's fitness value is strictly greater than this threshold, they will choose the challenging climb; otherwise, they will choose the leisure sightseeing route.
There are currently

people. For the

-th person, their fitness value is

. If they take the leisure sightseeing route, their satisfaction value is

; if they take the challenging climbing route, their satisfaction value is

. Before the activities begin, you may reset this fitness threshold so that the total satisfaction value of these

people is maximized. You only need to find this maximum possible value.
Note: the fitness threshold can be set to 0, in which case everyone will take the challenging climbing route; it can also be set to infinity, in which case everyone will take the leisure sightseeing route.