5 10 20 30 40 50 4 3 45 4 20 1 35 2 60
239 An optimal sequence of movements for the persons is as follows (the positions of the persons are not necessarily drawn to scale):  For each task, the persons move as follows. * The 4th person moves $6$ steps east, and the 3rd person moves $15$ steps east. * The 2nd person moves $2$ steps west, the 3rd person moves $26$ steps west, and the 4th person moves $26$ steps west. * The 4th person moves $18$ steps east, the 3rd person moves $18$ steps east, the 2nd person moves $18$ steps east, and the 1st person moves $25$ steps east. * The 5th person moves $13$ steps east, the 4th person moves $24$ steps east, the 3rd person moves $24$ steps east, and the 2nd person moves $24$ steps east. The total number of movements is $21+54+79+85=239$. You cannot complete all tasks with a total movement count of $238$ or less, so print `239`.
8 0 1 2 3 4 5 6 100000000 6 1 100000000 8 0 1 100000000 8 4 1 100000000 5 21006578
4294967297
Note that some persons may need to move to the west of the origin or more than $10^8$ meters to the east of it.
Also, note that the answer may exceed $2^{32}$.12 1558 3536 3755 3881 4042 4657 5062 7558 7721 8330 8542 9845 8 9 1694 7 3296 12 5299 5 5195 5 5871 1 2491 8 1149 8 2996
89644
{
"problem": {
"name": "Takahashi in Narrow Road",
"description": {
"content": "There is a road extending east and west, and $N$ persons are on the road. The road extends infinitely long to the east and west from a point called the origin. The $i$\\-th person $(1\\leq i\\leq N)$ is ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc371_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "There is a road extending east and west, and $N$ persons are on the road. The road extends infinitely long to the east and west from a point called the origin.\nThe $i$\\-th person $(1\\leq i\\leq N)$ is ...",
"is_translate": false,
"language": "English"
}
]
}