3 1 1 2 2 2 1 2 2 2 1 1 1
3 The maximum total damage can be achieved as follows. * As the $1$\-st spells, use $a_1=1,\, b_1=1$, increasing both $X$'s and $Y$'s magic powers to $1$. * As the $2$\-nd spells, use $c_2=2,\, d_2=2$, dealing $2$ points of damage in total. * As the $3$\-rd spells, use $a_3=2,\, b_3=1$, dealing $1$ point of damage by $X$'s spell and increasing $Y$'s magic power to $2$.
5 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
0 Casting Spell $2$ with a magic power of $0$ deals no damage.
8 1 1 2 2 2 2 2 1 1 1 2 1 1 1 2 2 2 1 1 1 1 2 1 2 2 1 1 2 2 1 2 1
20
20 2 1 2 1 2 1 1 1 1 2 1 1 2 2 1 2 2 2 2 1 1 1 2 1 1 2 2 2 2 2 2 1 1 1 1 2 1 2 1 2 1 2 2 2 2 1 1 2 2 1 1 1 1 2 1 2 1 2 1 2 1 1 1 2 1 1 2 1 2 2 1 1 1 2 2 2 2 1 1 2
138
{
"problem": {
"name": "Paired Wizards",
"description": {
"content": "Two wizards, $X$ and $Y$, are fighting with a monster. Initially, each of the wizards has a magic power of $0$. They know the following two spells. * Spell $1$: Increases the caster's magic power b",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 3000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "arc142_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Two wizards, $X$ and $Y$, are fighting with a monster.\nInitially, each of the wizards has a magic power of $0$. They know the following two spells.\n\n* Spell $1$: Increases the caster's magic power b...",
"is_translate": false,
"language": "English"
}
]
}