How can I increment values by assigning different percentage
<p>The question might be related more to math than to programming. I'll explain the question by an example.
Let's say I have an array with 100 items and I want to assign values to these items in such a way that the total of values in the first 80% of the items is 20% and the total of the values in the last 20% of the items is 80%. That is, the first 80% of the items get 20% and the rest get 80%.  Knowing that the number of the items is determined at run time. </p>

<p>Is this possible? </p>

<p>Thanks.</p>
