Ensure that you are logged in and have the required permissions to access the test.
Yash and Harsh decide to play an interesting game with an array of numbers, wherein they choose a number from the array in each round alternatively.
According to this game, in every round, a person chooses a number and gets a score equal to the number chosen. And this number is chosen
on the basis of number of divisors of that number. A person playing this game must choose the number with maximum number of divisors.After choosing the number, it gets decreased by 1.
If 2 or more numbers have same number of divisors that are maximum then person chooses the larger of those numbers.
If the game start with Yash and continues till all the elements of the array are consumed (i.e. all the numbers become 0), print the final scores of Yash and Harsh.
INPUT
First line contain an integer N.
Next line contains N space separated integers.
OUTPUT
Output 2 space separated integers denoting final scores of Yash and Harsh.
CONSTRAINTS
1≤N≤103
1≤A[i]≤104