#include #include #include using namespace std; vector a1; vector a2; double x (int n, vector a) { double answer = 0.0; for (int i = 0; i < n; ++i) { answer += a[i]; } return answer / n; } double s (int n, double x, vector a) { double answer = 0.0; for (int i = 0; i < n; ++i) { answer += (a[i] - x) * (a[i] - x); } return answer / (n - 1); } double x_y (int n1, int n2, double x1, double x2) { return (x1 * n1 + x2 * n2) / (n1 + n2); } double s_y (int n1, int n2, double s1, double s2) { return sqrt ((s1 * (n1 - 1) + s2 * (n2 - 1)) / (n1 + n2 - 2)); } double gist () { for (int i = 0; i < a2.size(); ++i) { a1.push_back (a2[i]); } sort (a1.begin(), a1.end()); cout << "min " << a1[0] << endl << "max " << a1[a1.size() - 1] << endl; return (a1[a1.size() - 1] - a1[0]) / 10; } int main() { freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); int n1, n2; double tmp, x1, x2, s1, s2, xy, sy; cin >> n1; for (int i = 0; i < n1; ++i) { cin >> tmp; a1.push_back(tmp); } cin >> n2; for (int i = 0; i < n2; ++i) { cin >> tmp; a2.push_back(tmp); } x1 = x (n1, a1); x2 = x (n2, a2); s1 = s (n1, x1, a1); s2 = s (n2, x2, a2); xy = x_y (n1, n2, x1, x2); sy = s_y (n1, n2, s1, s2); cout << x1 << endl; cout << x2 << endl; cout << sqrt (s1) << endl; cout << sqrt (s2) << endl; cout << xy << endl; cout << sy << endl; cout << gist () << endl; return 0; }