CF1119G Get Ready for the Battle
Description
Recently Evlampy installed one interesting computer game, one of aspects of which is to split army into several groups and then fight with enemy's groups. Let us consider a simplified version of the battle.
In the nearest battle Evlampy should fight an enemy army that consists of $ m $ groups, the $ i $ -th of which has $ hp_i $ health points.
Evlampy's army consists of $ n $ equal soldiers. Before each battle he should split his army in exactly $ m $ groups (possibly, empty) so that the total size of the groups is $ n $ . The battle is played step-by-step. On each step each of Evlampy's groups attacks exactly one enemy group. Thus, each step is described with an array of $ m $ integers $ a_1, a_2, \ldots, a_m $ , meaning that the $ i $ -th Evlampy's group attacks the $ a_i $ -th enemy group. Different groups can attack same group, on each step the array $ a $ is chosen independently.
After each step the health points of each enemy group decreases by the total number of soldiers in Evlampy's groups that attacked this enemy group at this step. Enemy group is destroyed once its health points are zero or negative. Evlampy's soldiers do not lose health.
An example of a step. The numbers in green circles represent the number of soldiers in Evlampy's groups, the arrows represent attacks, the numbers in red circles represent health points of enemy groups, the blue numbers represent how much the health points will decrease after the step.Evlampy understands that the upcoming battle will take the whole night. He became sad because this way he won't have enough time to finish his homework. Now Evlampy wants you to write a program that will help him win in the smallest possible number of steps. Can you help him?
In other words, find the smallest number of steps needed to destroy all enemy groups and show a possible way of doing this. Find the requires splitting of the army into $ m $ groups and the arrays $ a $ for each step.
Input Format
N/A
Output Format
N/A
Explanation/Hint
The first example is shown below.
