M. Maratona Brasileira de Popcorn

Codeforces
IDCF10234M
Time1000ms
Memory256MB
Difficulty
English · Original
Formal · Original
The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf [samples]
**Definitions** Let $ t \in \mathbb{Z} $ be the number of test cases. Let $ T = \{(n_k, A_k) \mid k \in \{1, \dots, t\}\} $ be the set of test cases, where for each $ k $: - $ n_k \in \mathbb{Z} $ denotes the length of the sequence. - $ A_k = (a_{k,1}, a_{k,2}, \dots, a_{k,n_k}) $ is a sequence of integers. **Constraints** 1. $ 1 \le t \le 1000 $ 2. For each $ k \in \{1, \dots, t\} $: - $ 1 \le n_k \le 50 $ - $ 1 \le a_{k,i} \le 100 $ for all $ i \in \{1, \dots, n_k\} $ **Objective** For each test case $ k \in \{1, \dots, t\} $, compute the alternating sum: $$ S_k = \sum_{i=1}^{n_k} (-1)^{i-1} a_{k,i} $$
API Response (JSON)
{
  "problem": {
    "name": "M. Maratona Brasileira de Popcorn",
    "description": {
      "content": "The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CF10234M"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "The complete problemset is available on http://maratona.ime.usp.br/primfase19/provas/competicao/maratona_en.pdf\n\n[samples]...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ t \\in \\mathbb{Z} $ be the number of test cases.  \nLet $ T = \\{(n_k, A_k) \\mid k \\in \\{1, \\dots, t\\}\\} $ be the set of test cases, where for each $ k $:  \n- $ n_k \\in \\mathbb{Z}...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments