#K34522. Unique Mean Calculation

    ID: 25328 Type: Default 1000ms 256MiB

Unique Mean Calculation

Unique Mean Calculation

Given an array of integers, you are required to compute the arithmetic mean of the unique elements in the array. The process involves:

  • Extracting the unique elements from the array.
  • Sorting these unique elements in non-decreasing order.
  • Calculating the mean (average) of the sorted unique elements.

The result should be printed as a floating point number. For example, if the array is [1, 2, 2, 3, 3, 3, 4, 4, 4, 4], the unique elements are [1, 2, 3, 4] whose mean is \(\frac{1+2+3+4}{4} = 2.5\).

inputFormat

The input is read from stdin and consists of two lines:

  1. The first line contains an integer \(N\) representing the number of elements in the array.
  2. The second line contains \(N\) space-separated integers.

outputFormat

Output the mean of the unique elements as a floating point number to stdout. The answer should be printed with one digit after the decimal point.

## sample
10
1 2 2 3 3 3 4 4 4 4
2.5

</p>