100 枚硬币分堆最大化乘积
Penny Stack
题目详情
你有 100 枚 1 分硬币,可以任意分成若干堆,每堆放任意枚数。你的收益等于各堆硬币数的乘积。
例如分成 10、20、70 三堆,收益为 。
最优分法的收益可写为 ,其中 互素。求 。
You are given pennies. You may arrange these pennies into however many stacks you want and put as many pennies into each stack as you would like. You are paid out the product of the number of pennies among all of the stacks. For example, if you make three stacks of sizes and , your payout is . The optimal arrangement of the pennies will give you a payout of , where and are relatively prime. Find .
解析
为了最大化乘积,应尽量把 100 分拆成尽可能多的 3(接近 的整数)。
,但留下的 1 不优;把一个 3 与 1 合并成 4,得到
因此 ,所求 。
Original Explanation
We want to make the product as large as possible. Therefore, if we view the number of coins in each pile as a side length, we want to maximize our value as much as possible. A cube maximizes the volume here, which is the product of the side lengths, so we want to get to a cube or as close to it as possible. Let's start with stacks of , as . If we divide each stack of into two stacks of , then we get a larger product, as each stack of now contributes to our product instead of . Therefore, we now have stacks of . However, as and , we should divide them up again. Now, we are going to try as many stacks of as possible. This would yields stacks of and a lone penny. However, this is not optimal, as removing one of our stacks of and putting it with the lone penny yields . As we can't divide into anything more optimal, our solution is , so the answer to the answer is .