H. Mysterious Photos

Codeforces
IDCF10018H
Time2000ms
Memory256MB
Difficulty
English · Original
Formal · Original
Everyone probably heard the rumours about the constellation of Bermuda Triangle: any person who looks to this constellation of three stars is said to disappear completely. Though, it's not clear who then spreads these rumours. Recently two photos have been sent to the editorial office of the newspaper you work on. Each photo depicts three glowing points on the dark background. The note applied to the photos indicates that they are the photos of the constellation of the Bermuda Triangle. Of course, the editors cannot check if it's true without the risk of the stuff. But at least it is possible to make sure that each photo depicts the same triple of stars. Remember that photos could be taken with the different zoom and rotation. They could also be taken with the help of a mirror in order to decrease the risk of triggering the curse. As a regular programmer of the newspaper you have the task to determine if these photos can depict the same triple of stars. The input consists of 6 lines. Each of the first three lines contains two integers separated by space — the coordinates of stars on the first photo. Each of the next three lines also contains two integers — the coordinates of stars on the second photo. All coordinates are between  - 104 and 104, inclusively. Stars on each photo don't coincide and don't lie on the same line. Output «_YES_» if the photos can depict the same triple of stars and «_NO_» otherwise. ## Input The input consists of 6 lines. Each of the first three lines contains two integers separated by space — the coordinates of stars on the first photo. Each of the next three lines also contains two integers — the coordinates of stars on the second photo. All coordinates are between  - 104 and 104, inclusively. Stars on each photo don't coincide and don't lie on the same line. ## Output Output «_YES_» if the photos can depict the same triple of stars and «_NO_» otherwise. [samples]
**Definitions** Let $ P = \{p_1, p_2, p_3\} \subset \mathbb{R}^2 $ and $ Q = \{q_1, q_2, q_3\} \subset \mathbb{R}^2 $ be two sets of three distinct non-collinear points in the plane, representing the star coordinates from the first and second photo, respectively. **Constraints** - All coordinates are integers in $[-10^4, 10^4]$. - Points in $P$ are distinct and non-collinear. - Points in $Q$ are distinct and non-collinear. **Objective** Determine whether there exists an isometry $ f: \mathbb{R}^2 \to \mathbb{R}^2 $ (composition of translation, rotation, reflection) such that $ f(P) = Q $ as sets. Output "YES" if such an isometry exists; otherwise, output "NO".
API Response (JSON)
{
  "problem": {
    "name": "H. Mysterious Photos",
    "description": {
      "content": "Everyone probably heard the rumours about the constellation of Bermuda Triangle: any person who looks to this constellation of three stars is said to disappear completely. Though, it's not clear who t",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 2000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10018H"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "Everyone probably heard the rumours about the constellation of Bermuda Triangle: any person who looks to this constellation of three stars is said to disappear completely. Though, it's not clear who t...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ P = \\{p_1, p_2, p_3\\} \\subset \\mathbb{R}^2 $ and $ Q = \\{q_1, q_2, q_3\\} \\subset \\mathbb{R}^2 $ be two sets of three distinct non-collinear points in the plane, representing th...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments