161. Haircut

Codeforces
IDCF10269161
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
After the end of hair salon restrictions of quarantine, many clients come to get their hair cut. Naturally, after months of uncut hair, your client's hairdos can be quite long! Your clients all have a preference of how long their hair needs to be after it is cut, and you can measure how long their hair is once you start cutting their hair. You must determine how much hair you have to cut in order to reach the specified length of hair the client requested. The first line will contain an integer $n$ which denotes the amount of test cases that will follow. Each line succeeding this value will contain two space separated integers representing the length in hair (in inches), the first one being the length of hair your client has at the beginning of the haircut, and the second being the length of hair your client wishes to have at the end of the haircut. For each test case, print the amount of hair you must cut in order to fit the client's requirements. ## Input The first line will contain an integer $n$ which denotes the amount of test cases that will follow. Each line succeeding this value will contain two space separated integers representing the length in hair (in inches), the first one being the length of hair your client has at the beginning of the haircut, and the second being the length of hair your client wishes to have at the end of the haircut. ## Output For each test case, print the amount of hair you must cut in order to fit the client's requirements. [samples]
**Definitions** Let $ n \in \mathbb{Z} $ be the number of test cases. For each test case $ i \in \{1, \dots, n\} $, let $ s_i \in \mathbb{R}^+ $ be the initial hair length and $ t_i \in \mathbb{R}^+ $ be the target hair length. **Constraints** 1. $ 1 \leq n \leq \text{some upper bound (implied by input)} $ 2. For each $ i \in \{1, \dots, n\} $: $ s_i \geq t_i \geq 0 $ **Objective** For each test case $ i $, compute the amount of hair to cut: $$ c_i = s_i - t_i $$
API Response (JSON)
{
  "problem": {
    "name": "161. Haircut",
    "description": {
      "content": "After the end of hair salon restrictions of quarantine, many clients come to get their hair cut. Naturally, after months of uncut hair, your client's hairdos can be quite long! Your clients all have a",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269161"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "After the end of hair salon restrictions of quarantine, many clients come to get their hair cut. Naturally, after months of uncut hair, your client's hairdos can be quite long! Your clients all have a...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z} $ be the number of test cases.  \nFor each test case $ i \\in \\{1, \\dots, n\\} $, let $ s_i \\in \\mathbb{R}^+ $ be the initial hair length and $ t_i \\in \\mathbb{R}...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments