4 10 4 2 3 2
20 Consider the following scenario. Below, $X \bmod Y$ denotes the remainder when a non-negative integer $X$ is divided by a positive integer $Y$. 1. Take the first and third balls from the box to score $(4^3 + 3^4) \bmod 10 = 5$ points. Then, eat the first ball and return the third to the box. Now, the box has the second, third, and fourth balls. 2. Take the third and fourth balls from the box to score $(3^2 + 2^3) \bmod 10 = 7$ points. Then, eat the third ball and return the fourth to the box. Now, the box has the second and fourth balls. 3. Take the second and fourth balls from the box to score $(2^2 + 2^2) \bmod 10 = 8$ points. Then, eat the second ball and return the fourth to the box. Now, the box has just the fourth ball. Here, Takahashi scores a total of $5 + 7 + 8 = 20$ points, which is the maximum possible value.
20 100 29 31 68 20 83 66 23 84 69 96 41 61 83 37 52 71 18 55 40 8
1733
{
"problem": {
"name": "Choose Two and Eat One",
"description": {
"content": "A box contains $N$ balls, each with an integer between $1$ and $M-1$ written on it. For $i = 1, 2, \\ldots, N$, the integer written on the $i$\\-th ball is $A_i$. While the box has two or more balls rem",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc282_e"
},
"statements": [
{
"statement_type": "Markdown",
"content": "A box contains $N$ balls, each with an integer between $1$ and $M-1$ written on it. For $i = 1, 2, \\ldots, N$, the integer written on the $i$\\-th ball is $A_i$.\nWhile the box has two or more balls rem...",
"is_translate": false,
"language": "English"
}
]
}