#K55727. Super Cyclic Sum
Super Cyclic Sum
Super Cyclic Sum
You are given an array of integers. The Super Cyclic Sum is defined as follows: For an array of length n and its set of unique elements U, the super cyclic sum is given by
$$ S = n \times \sum_{x \in U} x $$
In other words, despite repeating the array k times for each k = 1, 2, \dots, n, the unique elements remain the same so that the sum for each repetition is \(\sum_{x \in U} x\), and aggregating over all repetitions gives the formula above.
Your task is to compute the Super Cyclic Sum for the given array.
inputFormat
The first line contains an integer n (1 ≤ n ≤ 105), representing the number of elements in the array. The second line contains n space-separated integers, each representing an element of the array.
outputFormat
Output a single integer representing the Super Cyclic Sum computed as \(n \times \sum_{x \in U} x\), where \(U\) is the set of unique elements in the array.
## sample3
1 2 2
9
</p>