#include #include #include #include #include using namespace std; struct point { int x, y; }; vector> tests; void calcMinMax(int t, int64_t& min, int64_t& max) { auto& test = tests[t]; auto N = test.size(); if (N >= 3) { min = numeric_limits::max(); max = 0; for (size_t i = 0; i < N - 2; i++) { auto& pi = test[i]; int x1 = pi.x, y1 = pi.y; for (size_t j = i + 1; j < N - 1; j++) { auto& pj = test[j]; int x2 = pj.x, y2 = pj.y; for (size_t k = j + 1; k < N; k++) { auto& pk = test[k]; int x3 = pk.x, y3 = pk.y; int64_t p = abs((int64_t)x1 * (y2 - y3) + (int64_t)x2 * (y3 - y1) + (int64_t)x3 * (y1 - y2)); if (min > p) min = p; if (max < p) max = p; } } } } else { min = max = 0; } } int main() { int T; ifstream fin("triangle.in"); fin >> T; tests.resize(T); for (int t = 0; t < T; t++) { auto& test = tests[t]; int N; fin >> N; test.resize(N); for (int p = 0; p < N; p++) { int x, y; fin >> x >> y; test[p] = { x, y }; } } ofstream fout("triangle.out"); for (int t = 0; t < T; t++) { int64_t min, max; calcMinMax(t, min, max); fout << min * 0.5 << " " << max * 0.5 << endl; } return 0; }