H. Another Square in the Floor

Codeforces
IDCF10108H
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
While planning the SCPC2015 contest floor, each team has been assigned an area of a rectangular shape. The area covers the maximum region the team is allowed to move around during the contest. When Noura saw the contest floor, she didn't like the rectangular shapes. She asked the organizers to reassign each team for a square shaped area instead of a rectangular one. Given the sides of a rectangle, help the organizers find the square with minimum area, that covers the rectangle. To make it easier for the organizers, each side of the square must be parallel to one of the sides of the rectangle. The first line of input contains an integer T (1 ≤ T ≤ 1024), the number of test cases. Each test case contains two space-separated integers X, Y (1 ≤ X, Y ≤ 1000), the dimensions of the rectangular shaped area. For each test case, print on a single line, the area of the square described in the problem statement. Warning: large Input/Output data, be careful with certain languages. ## Input The first line of input contains an integer T (1 ≤ T ≤ 1024), the number of test cases.Each test case contains two space-separated integers X, Y (1 ≤ X, Y ≤ 1000), the dimensions of the rectangular shaped area. ## Output For each test case, print on a single line, the area of the square described in the problem statement. [samples] ## Note Warning: large Input/Output data, be careful with certain languages.
**Definitions** Let $ T \in \mathbb{Z} $ be the number of test cases. For each test case $ k \in \{1, \dots, T\} $, let $ (x_k, y_k) \in \mathbb{Z}^2 $ denote the dimensions of a rectangle. **Constraints** 1. $ 1 \le T \le 1024 $ 2. For each $ k $, $ 1 \le x_k, y_k \le 1000 $ **Objective** For each test case $ k $, find the minimum area of a square with sides parallel to the rectangle that can cover it. Let $ s_k = \max(x_k, y_k) $. The area of the square is: $$ s_k^2 $$
API Response (JSON)
{
  "problem": {
    "name": "H. Another Square in the Floor",
    "description": {
      "content": "While planning the SCPC2015 contest floor, each team has been assigned an area of a rectangular shape. The area covers the maximum region the team is allowed to move around during the contest. When N",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10108H"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "While planning the SCPC2015 contest floor, each team has been assigned an area of a rectangular shape. The area covers the maximum region the team is allowed to move around during the contest.\n\nWhen N...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ T \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ k \\in \\{1, \\dots, T\\} $, let $ (x_k, y_k) \\in \\mathbb{Z}^2 $ denote the dimensions of a rectangle.\n\n**Con...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments