API Response (JSON)
{
"problem": {
"name": "A. 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": "CF963A"
},
"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 -...",
"is_translate": true,
"language": "Chinese"
},
{
"statement_type": "Markdown",
"content": "**Definitions** \nLet $ M = 10^9 + 9 $. \nLet $ n, a, b, k \\in \\mathbb{Z} $ with constraints $ 1 \\le n \\le 10^9 $, $ 1 \\le a, b \\le 10^9 $, $ 1 \\le k \\le 10^5 $. \nLet $ S = (s_0, s_1, \\dots, s_{k-1})...",
"is_translate": false,
"language": "Formal"
}
]
}