5 3 3 1 4 1 5 9 2 6 5 3 5 8 9 7 9
56 Consider having the $2$\-nd, $4$\-th and $5$\-th kinds of cakes. The total beauty, tastiness and popularity will be as follows: * Beauty: $1 + 3 + 9 = 13$ * Tastiness: $5 + 5 + 7 = 17$ * Popularity: $9 + 8 + 9 = 26$ The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is $13 + 17 + 26 = 56$. This is the maximum value.
5 3 1 -2 3 -4 5 -6 7 -8 -9 -10 11 -12 13 -14 15
54 Consider having the $1$\-st, $3$\-rd and $5$\-th kinds of cakes. The total beauty, tastiness and popularity will be as follows: * Beauty: $1 + 7 + 13 = 21$ * Tastiness: $(-2) + (-8) + (-14) = -24$ * Popularity: $3 + (-9) + 15 = 9$ The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is $21 + 24 + 9 = 54$. This is the maximum value.
10 5 10 -80 21 23 8 38 -94 28 11 -26 -2 18 -69 72 79 -26 -86 -54 -72 -50 59 21 65 -32 40 -94 87 -62 18 82
638 If we have the $3$\-rd, $4$\-th, $5$\-th, $7$\-th and $10$\-th kinds of cakes, the total beauty, tastiness and popularity will be $-323$, $66$ and $249$, respectively. The value (the absolute value of the total beauty) + (the absolute value of the total tastiness) + (the absolute value of the total popularity) here is $323 + 66 + 249 = 638$. This is the maximum value.
3 2 2000000000 -9000000000 4000000000 7000000000 -5000000000 3000000000 6000000000 -1000000000 8000000000
30000000000 The values of the beauty, tastiness and popularity of the cakes and the value to be printed may not fit into 32-bit integers.
{
"problem": {
"name": "Patisserie ABC",
"description": {
"content": "Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100. The shop sells $N$ kinds of cakes. Each kind of cake has three parameters \"beauty\", ",
"description_type": "Markdown"
},
"platform": "AtCoder",
"limit": {
"time_limit": 2000,
"memory_limit": 262144
},
"difficulty": "None",
"is_remote": true,
"is_sync": true,
"sync_url": null,
"sign": "abc100_d"
},
"statements": [
{
"statement_type": "Markdown",
"content": "Takahashi became a pastry chef and opened a shop _La Confiserie d'ABC_ to celebrate AtCoder Beginner Contest 100.\nThe shop sells $N$ kinds of cakes. \nEach kind of cake has three parameters \"beauty\", ...",
"is_translate": false,
"language": "English"
}
]
}