Split all players into teams of exactly two players so that every team has the same sum of skills. The array skill has even length, and each entry is one player's skill. A team's chemistry is the product of its two skills. Return the total chemistry of the teams, or -1 if no valid division exists.
Example 1:
Input: skill = [1,4,2,3]
Output: 10Explanation: Pair 1 with 4 and 2 with 3. Both teams have total skill 5, and their chemistry totals 1 * 4 + 2 * 3 = 10.
Example 2:
Input: skill = [2,2,2,2]
Output: 8Explanation: Any pairing makes two teams with total skill 4. Each team contributes chemistry 2 * 2 = 4, so the total is 8.
Example 3:
Input: skill = [1,1,1,3]
Output: -1Explanation: The player with skill 3 must pair with a skill-1 player, making total skill 4. The two remaining skill-1 players sum to only 2, so an equal-skill division is impossible.
Constraints:
2 <= skill.length <= 1000001 <= skill[i] <= 1000- The array length is even.