2021-06-15 00:49:18 -07:00
|
|
|
---
|
|
|
|
id: 5900f42b1000cf542c50ff3d
|
2021-11-11 08:02:39 -08:00
|
|
|
title: 'Problema 190: Maximização de um produto ponderado'
|
2021-06-15 00:49:18 -07:00
|
|
|
challengeType: 5
|
|
|
|
forumTopicId: 301828
|
|
|
|
dashedName: problem-190-maximising-a-weighted-product
|
|
|
|
---
|
|
|
|
|
|
|
|
# --description--
|
|
|
|
|
2021-11-11 08:02:39 -08:00
|
|
|
Considere $S_m = (x_1, x_2, \ldots, x_m)$ a $m$-ésima tupla de números reais positivos com $x_1 + x_2 + \cdots + x_m = m$ para a qual $P_m = x_1 \times {x_2}^2 \times \cdots \times {x_m}^m$ é maximizado.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-11 08:02:39 -08:00
|
|
|
Por exemplo, pode-se verificar que $[P_{10}] = 4112$ ([ ] é a parte inteira da função).
|
2021-06-15 00:49:18 -07:00
|
|
|
|
2021-11-11 08:02:39 -08:00
|
|
|
Encontre $\sum {[P_m]}$ para $2 ≤ m ≤ 15$.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
# --hints--
|
|
|
|
|
2021-11-11 08:02:39 -08:00
|
|
|
`maximisingWeightedProduct()` deve retornar `371048281`.
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
```js
|
2021-11-11 08:02:39 -08:00
|
|
|
assert.strictEqual(maximisingWeightedProduct(), 371048281);
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --seed--
|
|
|
|
|
|
|
|
## --seed-contents--
|
|
|
|
|
|
|
|
```js
|
2021-11-11 08:02:39 -08:00
|
|
|
function maximisingWeightedProduct() {
|
2021-06-15 00:49:18 -07:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-11-11 08:02:39 -08:00
|
|
|
maximisingWeightedProduct();
|
2021-06-15 00:49:18 -07:00
|
|
|
```
|
|
|
|
|
|
|
|
# --solutions--
|
|
|
|
|
|
|
|
```js
|
|
|
|
// solution required
|
|
|
|
```
|