179. Engineering Challenge

Codeforces
IDCF10269179
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
For an engineering challenge, you have to make a project which has a certain height $n$, with a tolerance of $k$. This means that any height between $n$ - $k$ and $n$ + $k$ will be acceptable. For example, if $n$ was equal to 5, and $k$ was equal to 2, any height between 3 and 7, inclusive, would be acceptable. Given these values $n$ and $k$, figure out the lower and upper height limit for the engineering project. The input consists of two lines: positive integers $n$ and $k$, each on separate lines. Output two lines. On the first line, output the lower height limit, as described above. On the second line, output the upper height limit, as described above. ## Input The input consists of two lines: positive integers $n$ and $k$, each on separate lines. ## Output Output two lines. On the first line, output the lower height limit, as described above. On the second line, output the upper height limit, as described above. [samples]
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the target height. Let $ k \in \mathbb{Z}^+ $ be the tolerance. **Constraints** $ n \geq 1 $, $ k \geq 1 $ **Objective** Compute: - Lower limit: $ n - k $ - Upper limit: $ n + k $
API Response (JSON)
{
  "problem": {
    "name": "179. Engineering Challenge",
    "description": {
      "content": "For an engineering challenge, you have to make a project which has a certain height $n$, with a tolerance of $k$. This means that any height between $n$ - $k$ and $n$ + $k$ will be acceptable. For exa",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269179"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "For an engineering challenge, you have to make a project which has a certain height $n$, with a tolerance of $k$. This means that any height between $n$ - $k$ and $n$ + $k$ will be acceptable. For exa...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the target height.  \nLet $ k \\in \\mathbb{Z}^+ $ be the tolerance.  \n\n**Constraints**  \n$ n \\geq 1 $, $ k \\geq 1 $\n\n**Objective**  \nCompute:  \n- Lower li...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments