Company: Amazon_17feb
Difficulty: medium
Minimize Total Expense with OptiBatch Kit With Amazon's new innovative OptiBatch Kit users can effortlessly optimize the arrangement of their processing batches. This kit is designed to minimize the overall expense needed for efficient processing. The process starts with an array of batches, and the objective is to reduce the total expense required. The expense is the sum of expenses needed for each batch. Formally, given an array expense of size p , utilizing the OptiBatch Kit, users can perform operations on the array. In each operation, the user chooses two positions a and b , such that the expense of the batch at position a ( expense[a] ) is divisible by the expense of the batch at position b ( expense[b] ). When this condition is satisfied, the expense of batch a can be updated to equal the expense of batch b . This operation can be repeated as many times as possible, on different batches or positions. An integer a is divisible by another integer b if a can be divided by b exactly