API Response (JSON)
{
"problem": {
"name": "C. Alternating Sum",
"description": {
"content": "You are given two integers $a$ and $b$. Moreover, you are given a sequence $s_0, s_1, \\dots, s_{n}$. All values in $s$ are integers $1$ or $-1$. It's known that sequence is $k$\\-periodic and $k$ divid",
"description_type": "Markdown"
},
"platform": "Codeforces",
"limit": {
"time_limit": 1000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "CF964C"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given two integers $a$ and $b$. Moreover, you are given a sequence $s_0, s_1, \\dots, s_{n}$. All values in $s$ are integers $1$ or $-1$. It's known that sequence is $k$\\-periodic and $k$ divid...",
"is_translate": false,
"language": "English"
},
{
"statement_type": "Markdown",
"content": "给定两个整数 $a$ 和 $b$,以及一个序列 $s_0, s_1, dots.h, s_n$。序列 $s$ 中的所有值均为整数 $1$ 或 $-1$。已知该序列是 $k$-周期的,且 $k$ 整除 $n + 1$。换句话说,对于每个 $k lt.eq i lt.eq n$,均有 $s_i = s_(i -k)$。\n\n求表达式 $sum limits_(i = 0)^n s_i a^(n -i) ...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ M = 10^9 + 9 $. \nLet $ n, a, b, k \\in \\mathbb{Z} $ with $ 1 \\leq n \\leq 10^9 $, $ 1 \\leq a, b \\leq 10^9 $, $ 1 \\leq k \\leq 10^5 $, and $ k \\mid (n+1) $. \nLet $ s = (s_0, s_1,...",
"is_translate": false,
"language": "Formal"
}
]
}