5 7 2 5 2 5 3 5 3 10 3 20
BBCBA The maximum possible total value when choosing items such that the total price is at most $7$ yen is $30$, which can be achieved by one of the following: * Choosing items $1$, $2$, and $5$. * Choosing items $4$ and $5$. (There is no other way to choose items such that the total price is at most $7$ yen and the total value is $30$.) Thus, the category of each item is as follows: * Item $5$ is an item that must be chosen to maximize the total value of the chosen items (category A). * Items $1$, $2$, and $4$ are items that may or may not be chosen to maximize the total value of the chosen items (category B). * Item $3$ is an item that must never be chosen to maximize the total value of the chosen items (category C). Therefore, according to the output format, print `BBCBA`.
7 3 1 1 1 1 1 2 1 2 1 2 1 3 1 3
CCBBBAA The total value is maximized when choosing any one of items $3$, $4$, $5$, along with items $6$ and $7$. Note that even if items have equal prices and values, they are still distinguished as different items.
{
"problem": {
"name": "Must Buy",
"description": {
"content": "A store sells $N$ items, numbered as item $1$, item $2$, $\\ldots$, item $N$. Item $i$ $(1\\leq i\\leq N)$ has a price of $P_i$ yen and a value of $V_i$. The store has only one stock of each item. Taka",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2500,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc441_f"
},
"statements": [
{
"statement_type": "Markdown",
"content": "A store sells $N$ items, numbered as item $1$, item $2$, $\\ldots$, item $N$. \nItem $i$ $(1\\leq i\\leq N)$ has a price of $P_i$ yen and a value of $V_i$. The store has only one stock of each item.\nTaka...",
"is_translate": false,
"language": "English"
}
]
}