F. Rect

Codeforces
IDCF10100F
Time1000ms
Memory4MB
Difficulty
English · Original
Formal · Original
Given points on a plane, output the area of a rectangle with its sides parallel with the coordinate axes that contains inside or on the sides at least points of the points given. The input file *drept.in* contains on the first lines 2 numbers and each of the following lines contains 2 numbers and describing the th point. The output file *drept.out* contains the required area. ## Input The input file *drept.in* contains on the first lines 2 numbers and each of the following lines contains 2 numbers and describing the th point. ## Output The output file *drept.out* contains the required area. [samples]
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the number of points. Let $ P = \{(x_i, y_i) \mid i \in \{1, \dots, n\}\} $ be a set of points in $ \mathbb{R}^2 $. **Constraints** Each point satisfies $ x_i, y_i \in \mathbb{R} $. **Objective** Find the minimum area $ A $ of an axis-aligned rectangle $ R = [x_{\min}, x_{\max}] \times [y_{\min}, y_{\max}] $ such that all $ n $ points lie inside or on the boundary of $ R $: $$ A = (x_{\max} - x_{\min}) \cdot (y_{\max} - y_{\min}) $$ where $$ x_{\min} = \min_{i} x_i, \quad x_{\max} = \max_{i} x_i, \quad y_{\min} = \min_{i} y_i, \quad y_{\max} = \max_{i} y_i $$
API Response (JSON)
{
  "problem": {
    "name": "F. Rect",
    "description": {
      "content": "Given  points on a plane, output the area of a rectangle with its sides parallel with the coordinate axes that contains inside or on the sides at least  points of the  points given. The input file *d",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 4096
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10100F"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Given  points on a plane, output the area of a rectangle with its sides parallel with the coordinate axes that contains inside or on the sides at least  points of the  points given.\n\nThe input file *d...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of points.  \nLet $ P = \\{(x_i, y_i) \\mid i \\in \\{1, \\dots, n\\}\\} $ be a set of points in $ \\mathbb{R}^2 $.\n\n**Constraints**  \nEach point sati...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments