149. Pythagorean Theorem

Codeforces
IDCF10269149
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
For this problem, you will be given two side lengths of a triangle and will be required to determine the length of the other side. You can assume that all input will be provided for a valid right triangle. The two side lengths you will be given correspond to the common variables $A$ and $C$, meaning one side and the hypotenuse. You should then output the length of side $B$. Two space-separated integer values that represent $A$ and $C$ respectively. A single floating point value that represents the length of side $B$. Make sure that you are finding the length of side $B$ and not $C$(the hypotenuse). ## Input Two space-separated integer values that represent $A$ and $C$ respectively. ## Output A single floating point value that represents the length of side $B$. [samples] ## Note Make sure that you are finding the length of side $B$ and not $C$(the hypotenuse).
**Definitions** Let $ A, C \in \mathbb{R}^+ $ be the given side and hypotenuse of a right triangle, respectively. Let $ B \in \mathbb{R}^+ $ be the unknown side to be determined. **Constraints** 1. $ A > 0 $, $ C > 0 $ 2. $ A < C $ (since $ C $ is the hypotenuse) 3. The triangle is a valid right triangle with legs $ A $ and $ B $, and hypotenuse $ C $. **Objective** Compute $ B $ using the Pythagorean theorem: $$ B = \sqrt{C^2 - A^2} $$
API Response (JSON)
{
  "problem": {
    "name": "149. Pythagorean Theorem",
    "description": {
      "content": "For this problem, you will be given two side lengths of a triangle and will be required to determine the length of the other side. You can assume that all input will be provided for a valid right tria",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269149"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "For this problem, you will be given two side lengths of a triangle and will be required to determine the length of the other side. You can assume that all input will be provided for a valid right tria...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ A, C \\in \\mathbb{R}^+ $ be the given side and hypotenuse of a right triangle, respectively.  \nLet $ B \\in \\mathbb{R}^+ $ be the unknown side to be determined.\n\n**Constraints** ...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments