Generalized static array analyzer

C# Medium generics

Task «Generalized static array analyzer»

Implement a static method `AnalyzeArray<T>` in the generic class `ArrayAnalyzer`, which takes an array of elements of type `T` and returns a tuple of three elements: the minimum value (type `T`), the maximum value (type `T`), and the arithmetic mean (type `double`). It is guaranteed that the array contains at least one element and that all elements support comparison (`IComparable<T>`). Output the result in the format: `min max average`. If the array is empty, throw an `ArgumentException`.

Input Format

First line: number of elements n (integer, n ≥ 1). Second line: n values separated by spaces (integers or floating-point numbers).

Output Format

One line: minimum value, maximum value, arithmetic mean (with precision up to two decimal places).

Examples

Example 1

INPUT
3 1 2 3
OUTPUT
1 3 2.00

Example 2

INPUT
4 -5.5 2.3 10.8 0.0
OUTPUT
-5.50 10.80 1.90

Example 3

INPUT
3 Alice 30 Bob 25 Charlie 30
OUTPUT
Bob 25 Alice 30 Charlie 30
main.cs