This is an Approximate Problem
You are given an array . Now you need to partition this array into several sub arrays where is the count of positions where you can perform a cut in the array. Note that the partitions should be continuous i.e. if you arrange all the partitions one after another they should form the initial array completely.
For example let the initial array be then example of few partitions are -
- contains two partitions
- contains three partitions
- contains four partitions
Now your goal is to partition the array in such a way that if we sum the count of divisors of the each individual partition sum then it should be as minimum as possible. Since this is an approximate problem every partition that follows the continuous condition is valid , only the scores will be different. It is recommended to go through the scoring section and the output section carefully.
Input
First line contains an integer as input. Next line contains space separated integers. Next line contains the value denoting the count of cuts you need to make.
Output
Your output should contain distinct space separated integers (ascending order) that denotes the positions of your cuts. Note that each position should belong to the range to both included.
For example : Suppose that the array is and you perform a partition then it means that there are cuts one before the index and one before the last index as the array is indexed from to . So one of the valid outputs will be -
2
1 3
Constraints
Scoring and Verdicts
If your output format does not matches the one described above then you may get a runtime error or a wrong answer. If the partition is correct then you will get AC with a certain score for which it may be possible to increase/decrease the score with certain optimizations.
Suppose that the sum of the count of divisors of each partition is then your score is and your goal is to minimize this score as much possible. Lesser the score more better is the solution.
In the sample output the partition is performed before the index which means that the array is partitioned into and . The partition sums are and . First partition has divisor count and second has divisor count . So here . The score will be which is 9.