1 5 3 5 4 3 3 1 2 3 4 5
7 11 0 11 7 * By performing operations $+a$, $-b$ on $A_1$ in order, we can make $A=(1)$. The total cost is $4+3=7$. * By performing operations $-a$, $-a$, $+b$ on $A_1$ in order, we can make $A=(2)$. The total cost is $4+4+3=11$. * $A=(3)$ from the beginning. The total cost is $0$. * By performing operations $+a$, $+a$, $-b$ on $A_1$ in order, we can make $A=(4)$. The total cost is $4+4+3=11$. * By performing operations $-a$, $+b$ on $A_1$ in order, we can make $A=(5)$. The total cost is $4+3=7$.
3 1 3 5 4 3 1 2 3 4
22 * By performing operations $+a$ on $A_1$, $+b$, $-a$ on $A_2$, and $+a,+a,-b$ on $A_3$ in order, we can make $A=(4,4,4)$. The total cost is $22$.
5 5 1234 4321 5 5 1 10 100 1000 10000 123 4567 89012345 6 789
45340 42530 531725 35135 41690
{
"problem": {
"name": "± ab",
"description": {
"content": "You are given an integer sequence $A=(A_1,A_2,\\ldots,A_N)$. Also, you are given positive integers $a,b,s,t$. It is guaranteed that $a$ and $b$ are **coprime**. You can perform the following four types",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 10000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc210_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "You are given an integer sequence $A=(A_1,A_2,\\ldots,A_N)$. Also, you are given positive integers $a,b,s,t$. It is guaranteed that $a$ and $b$ are **coprime**.\nYou can perform the following four types...",
"is_translate": false,
"language": "English"
}
]
}