406788: GYM102556 D Riana and Distribution of Pie
Description
Riana baked a round pie in preparation for her birthday party. After baking the pie, she thought that it would be boring to simply give the pie evenly across everyone attending her party. After some thought, she came up with the idea of using the pie in a game for the party goers.
In her game, each person attending the party will each take only one turn.
One full turn goes like this:
- Person $$$i$$$ begins his turn by choosing a percentage $$$P_i\%$$$ between 0-100.
- Person $$$i$$$ then takes $$$P_i\%$$$ of the pie remaining.
- Person $$$i$$$ ends his turn by taking $$$P_i\%$$$ of the slices of pie that have already been taken by everyone who went before person $$$i$$$.
For example, if four people Mathil, Quin, Octavian, and Velyna attend the party:
- In the first turn, Mathil starts by choosing 30%.
- He then takes 30% of the remaining pie which has not been touched, meaning Mathil takes 30%.
- Mathil has 30% of the pie.
- The pie is now 70% of its original size.
- In the second turnn Quin chooses 20%.
- Quin then takes 20% of what's left of the pie, which is 14% of the pie's original size.
- Next, Quin takes 20% of Mathil's slice, which is 6% of the pie's original size.
- Mathil now only has 24% of the pie, while Quin has (14%+6%) 20% of the pie's original size.
- The pie is now 56% of its original size.
- In the third turn, Octavian comes in and chooses 10%.
- Octavian take 10% of the what's left of the pie, which is 5.6% of the pie's original size.
- He then takes 10% of Mathil's remaining 24% and Quin's 20%
- Mathil now only has 21.6% of the pie's original size.
- Quin now only has 18% of the pie's original size.
- Octavian has 10% of the pie's original size.
- The pie is now 50.4% of its original size.
- In the fourth and final turn, Velyna comes in and chooses 50%.
- Velyna takes 50% of the what's left of the pie, which is 25.2% of the pie's original size.
- She then takes 50% of Mathil's remaining 21.6%, Quin's remaining 18%, and Octavian's 10%.
- Mathil now only has 10.8% of the pie's original size.
- Quin now only has 9% of the pie's original size.
- Octavian now only has 5% of the pie's original size.
- Velyna has 50% of the pie's original size.
- The pie is now 25.2% of its original size.
But wait! this is wrong! Riana's household has a strict 'no leftovers' policy, so she wants 100% of the pie to get eaten!
Riana is also an advocate of equality, so she wants to distribute the pie slices such that the difference between the biggest slice and the smallest slice is minimized.
However, Riana is also secretly lazy, so she enlisted the help of her friend, you! Help her figure out the optimal percentage each person should take.
InputThe input will contain one line containing a single integer $$$N$$$, the number of people going to the party.
The value $$$N$$$ is guaranteed to be between $$$1$$$ and $$$10^{3}$$$.
OutputOutput contains $$$N$$$ lines.
The $$$i$$$th line of the output must contain the percentage of the pie which the $$$i$$$th person to take slices should take. (The first person's percentage should be on the first line, the second should be on the second line, the third should be on the third line, etc.)
Answers will be accepted if they are within $$$10^{-4}$$$ away from the correct answer.
ExampleInput1Output
100.0000Note
In the sample test case, since the first person is the only person in the party (quite sad), he takes the whole cake.
This satisfies the two conditions that Riana wanted to satisfy:
- 100% of the cake is eaten.
- The difference between the Maximum and the Minimum is minimized. (The difference is 0.)