3 1 1 2
4 There are four permutations $p$ satisfying the condition: $(1,3,2),(2,3,1),(3,1,2),(3,2,1)$. If $p=(3,2,1)$, for example, the following will happen. * $i=1$: the total weights of the oranges Takahashi and Aoki have taken are $0$ and $0$, respectively. Takahashi takes Orange $p_i=3$. * $i=2$: the total weights of the oranges Takahashi and Aoki have taken are $2$ and $0$, respectively. Aoki takes Orange $p_i=2$. * $i=3$: the total weights of the oranges Takahashi and Aoki have taken are $2$ and $1$, respectively. Aoki takes Orange $p_i=1$. Thus, the permutation $p=(3,2,1)$ counts.
4 1 2 3 8
0
20 2 8 4 7 5 3 1 2 4 1 2 5 4 3 3 8 1 7 8 2
373835282
{
"problem": {
"name": "Greedy Division",
"description": {
"content": "We have $N$ oranges, numbered $1$ through $N$. The weight of Orange $i$ is $W_i$. Takahashi and Aoki will share these oranges as follows. * Choose a permutation $(p_1, p_2, \\cdots, p_N)$ of $(1,2,\\",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "agc054_b"
},
"statements": [
{
"statement_type": "Markdown",
"content": "We have $N$ oranges, numbered $1$ through $N$. The weight of Orange $i$ is $W_i$. Takahashi and Aoki will share these oranges as follows.\n\n* Choose a permutation $(p_1, p_2, \\cdots, p_N)$ of $(1,2,\\...",
"is_translate": false,
"language": "English"
}
]
}