136. Math Team

Codeforces
IDCF10269136
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
You're competing in a large individual math team contest. In the contest, you're given several sets of problems, and for each one of them you get a certain number of them correct. Given this information, you want to figure out your total score in the competition. For example, if you scored a 2 out of 3 on the first problem set, and a 3 out of 5 on the second problem set, your total score would be 5 out of 8. The first line of input contains a single positive integer $n$: the number of problem sets. The next $n$ lines contain two integers separated by a slash "/": the number of questions you got right in the problem set, and the total number of questions in the problem set. Output two slash-separated integers: the total number of questions you got right, and the total number of question you got wrong, respectively. ## Input The first line of input contains a single positive integer $n$: the number of problem sets.The next $n$ lines contain two integers separated by a slash "/": the number of questions you got right in the problem set, and the total number of questions in the problem set. ## Output Output two slash-separated integers: the total number of questions you got right, and the total number of question you got wrong, respectively. [samples]
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the number of problem sets. For each $ i \in \{1, \dots, n\} $, let $ r_i \in \mathbb{Z} $ be the number of correct answers and $ t_i \in \mathbb{Z} $ be the total number of questions in problem set $ i $. **Constraints** 1. $ n \geq 1 $ 2. For each $ i \in \{1, \dots, n\} $: $ 0 \leq r_i \leq t_i $ **Objective** Compute: - Total correct: $ R = \sum_{i=1}^{n} r_i $ - Total wrong: $ W = \sum_{i=1}^{n} (t_i - r_i) $ Output: $ R / W $
API Response (JSON)
{
  "problem": {
    "name": "136. Math Team",
    "description": {
      "content": "You're competing in a large individual math team contest. In the contest, you're given several sets of problems, and for each one of them you get a certain number of them correct. Given this informati",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10269136"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You're competing in a large individual math team contest. In the contest, you're given several sets of problems, and for each one of them you get a certain number of them correct. Given this informati...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of problem sets.  \nFor each $ i \\in \\{1, \\dots, n\\} $, let $ r_i \\in \\mathbb{Z} $ be the number of correct answers and $ t_i \\in \\mathbb{Z} $...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments