← 返回 amazon 的题目列表Maximum Primary Memory Sum
类型:online_judge
Given an array memory, where each element represents the memory of a server. You need to pair selected servers into pairs of one primary and one backup server. The backup server must have a memory value greater than or equal to that of the primary server. The goal is to maximize the total memory sum of all primary servers. Note that each server can only be used once and cannot belong to two pairs simultaneously. Please calculate the maximum possible sum of primary server memory.
Example
Input
4 5 6 2