#C4120. Calculate Statistical Insights

    ID: 47624 Type: Default 1000ms 256MiB

Calculate Statistical Insights

Calculate Statistical Insights

You are given a list of integers. Your task is to compute three statistical values from the list: the mean, the median, and the mode.

The mean is defined as \( \frac{1}{n}\sum_{i=1}^{n} a_i \), where \( n \) is the total number of elements.

The median is the middle value of the sorted list. If the list has an even number of elements, the median is the average of the two middle numbers.

The mode is the value that appears most frequently. In case of multiple values with the same highest frequency, you should output the smallest among them.

inputFormat

The first line of input contains a single integer \( n \), representing the number of elements in the list. The second line contains \( n \) space-separated integers.

outputFormat

Print the mean, median, and mode separated by a single space. The mean must be printed as a float value.

## sample
1
1
1.0 1 1