Maximize Score After N Ops

Given 2n integers, repeatedly pair up two remaining numbers and add their greatest common divisor to a score. Maximize the total score after n operations.

Examples
Input: [1,2]
Output: 1
Hints

Maximize Score After N Ops

Given 2n integers, repeatedly pair up two remaining numbers and add their greatest common divisor to a score. Maximize the total score after n operations.