6 4 13 2 3 2 6
4 30 2 13 2 13 As an example, consider the problem for $K = 4$. We will refer to the sizes of the remaining slimes, listed from left to right, with Takahashi's size enclosed in square brackets $[ ]$, as the **state of the row**. That is, the initial state is $(4, 13, 2, [3], 2, 6)$. Consider the following sequence of actions by Takahashi. * He absorbs the slime to his right. As a result, the absorbed slime disappears, and his size becomes $3 + 2 = 5$. The state becomes $(4, 13, 2, [5], 6)$. * He absorbs the slime to his left. As a result, the absorbed slime disappears, and his size becomes $5 + 2 = 7$. The state becomes $(4, 13, [7], 6)$. * He absorbs the slime to his right. As a result, the absorbed slime disappears, and his size becomes $7 + 6 = 13$. The state becomes $(4, 13, [13])$. There are no slimes adjacent to him that are strictly smaller than him, so he cannot perform any more actions. His final size is $13$, which is the maximum possible.
12 22 25 61 10 21 37 2 14 5 8 6 24
22 47 235 10 31 235 2 235 5 235 6 235
{
"problem": {
"name": "Takahashi is Slime",
"description": {
"content": "There are $N$ slimes lined up in a row from left to right. For $i = 1, 2, \\ldots, N$, the $i$\\-th slime from the left has size $A_i$. For each $K = 1, 2, \\ldots, N$, solve the following problem. > ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 5000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc189_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There are $N$ slimes lined up in a row from left to right. For $i = 1, 2, \\ldots, N$, the $i$\\-th slime from the left has size $A_i$. \nFor each $K = 1, 2, \\ldots, N$, solve the following problem.\n\n> ...",
"is_translate": false,
"language": "English"
}
]
}