Company: Goldman sachs_27july
Difficulty: medium
Optimal Fertilizer Mix Problem Description A farmer is trying to create a balanced fertilizer mix using N organic substances. Each organic substance has two properties: Growth Boost (G): A multiplicative factor that boosts plant growth. Soil Toxicity (T): An additive factor that negatively affects soil quality. To ensure optimal crop health, the farmer wants to combine organic substances such that the absolute difference between the total growth boost and the total toxicity is minimized. The total growth boost is the product of the G values of the chosen organic substances. The total toxicity is the sum of T values of the chosen organic substances. The farmer must use at least one substance — applying nothing has no effect. Write a program that accepts the number of organic substances and their corresponding growth boost and toxicity values, and prints the minimum possible absolute difference between total growth boost and total toxicity across all combinations of organic substances. C