Company: Infosys_7jan
Difficulty: medium
Minimum Cost to Partition Production Orders Description A factory must process N production orders indexed from 1 to N, where each order has a complexity value[i] . The orders must be divided into exactly B consecutive batches. For each batch covering orders from i to j , the total batch cost is determined by the following rules: Processing Cost: The processing cost of a batch is the minimum complexity value in the range [i, j] multiplied by the batch size (j - i + 1) . Setup Cost: The b-th batch (where b is 1-indexed) has a setup cost equal to 2 * b * (j - i + 1) , that is, 2 multiplied by the batch number multiplied by the size of the b-th batch. Maximum Complexity Difference Penalty: Let the maximum difference between any two complexity values in the batch be D. If D > V , then a penalty of P points is added. Fibonacci Bonus: If the size of the batch (j - i + 1) is exactly a Fibonacci number (1, 2, 3, 5, 8, 13, ...), then a discount of F points is subtracted from the total cost of t