H. Hour for a Run

Codeforces
IDCF10234H
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 $ n \in \mathbb{Z} $ be the number of lanterns. Let $ X = (x_1, x_2, \dots, x_n) $ be a strictly increasing sequence of lantern coordinates, where $ 0 \le x_1 < x_2 < \dots < x_n \le 10^{18} $. **Constraints** $ 3 \le n \le 3000 $ **Objective** Find the maximum size $ k $ of a subsequence $ (x_{i_1}, x_{i_2}, \dots, x_{i_k}) $ with $ i_1 < i_2 < \dots < i_k $ such that: $$ x_{i_2} - x_{i_1} = x_{i_3} - x_{i_2} = \dots = x_{i_k} - x_{i_{k-1}} $$ (i.e., the selected lanterns form an arithmetic progression). If $ k < 3 $, any selection is valid — but we seek the *maximum* such $ k $.
API Response (JSON)
{
  "problem": {
    "name": "H. Hour for a Run",
    "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": "CF10234H"
  },
  "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 $ n \\in \\mathbb{Z} $ be the number of lanterns.  \nLet $ X = (x_1, x_2, \\dots, x_n) $ be a strictly increasing sequence of lantern coordinates, where $ 0 \\le x_1 < x_2 < \\dots < x...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments