#include #include #include #include #include using namespace std; float calculate_size(pair a, pair b, pair c, pair d){ float length_b = sqrt((a.first - b.first) * (a.first - b.first) + (a.second - b.second) * (a.second - b.second)); float length_c = sqrt((a.first - c.first) * (a.first - c.first) + (a.second - c.second) * (a.second - c.second)); float length_d = sqrt((a.first - d.first) * (a.first - d.first) + (a.second - d.second) * (a.second - d.second)); if (length_b > length_c){ if (length_b > length_d){ return length_c * length_d; } else{ return length_c * length_b; } } else { if (length_c > length_d){ return length_b * length_d; } else{ return length_b * length_c; } } return -1; } int main(){ int n; cin >> n; deque> deque_x(n), deque_y; for (int i = 0; i < n; i++){ cin >> deque_x[i].first >> deque_x[i].second; } deque_y = deque_x; sort(deque_x.begin(), deque_x.end(), [] (pair a, pair b) { if (a.first == b.first) return a.second < b.second; return a.first < b.first; }); sort(deque_y.begin(), deque_y.end(), [] (pair a, pair b) { if (a.second == b.second) return a.first > b.first; return a.second < b.second; }); int max_x = deque_x[deque_x.size() - 1].first, max_y = deque_y[deque_y.size() - 1].second, min_x = deque_x[0].first, min_y = deque_y[0].second; while(deque_x.size() != 4){ pair rectangle_point = deque_x.front(); while (rectangle_point.second > max_y || rectangle_point.second < min_y) deque_x.pop_front(); deque_x.pop_front(); rectangle_point = deque_x.back(); while (rectangle_point.second > max_y || rectangle_point.second < min_y) deque_x.pop_back(); deque_x.pop_back(); max_x = deque_x[deque_x.size() - 1].first; min_x = deque_x[0].first; rectangle_point = deque_y.front(); while (rectangle_point.first > max_x || rectangle_point.first < min_x) deque_y.pop_front(); deque_y.pop_front(); rectangle_point = deque_y.back(); while (rectangle_point.first > max_x || rectangle_point.first < min_x) deque_y.pop_back(); deque_y.pop_back(); max_y = deque_y[deque_y.size() - 1].second; min_y = deque_y[0].second; } cout << calculate_size(deque_x[0], deque_x[1], deque_x[2], deque_x[3]) << endl; return 0; }