S001-AC.cc 473 Bytes
#include <iostream>
#include <iomanip>

using namespace std;

int main()
{
	int m, n;
	double num, min, max, avg;
	cin >> m;
	for(int i = 0; i < m; i++)
	{
		cin >> n;
		cin >> max;
		min = max;
		avg = max;
		for(int j = 1; j < n; j++)
		{
			cin >> num;
			if(num > max)
			{
				max = num;
			}
			if(num < min)
			{
				min = num;
			}
			avg += num;
		}
		avg /= n;
		cout << fixed << setprecision(4) << min << " " << max << " " << avg << endl;
	}
        return 0;
}