## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to maximize the return on investment for a fruit investor who has $300,000 to invest in four industries: apple, orange, pear, and banana. Each industry has a different rate of return: 5% for apple, 6% for orange, 3% for pear, and 8% for banana.

There are several restrictions on the investments:

1. The amount invested in the banana industry cannot exceed the amount invested in the apple industry.
2. The amount invested in the orange industry cannot exceed the amount invested in the pear industry.
3. At most 30% of the total amount can be invested in the banana industry.

## Mathematical Formulation

Let $A$, $O$, $P$, and $B$ be the amounts invested in the apple, orange, pear, and banana industries, respectively. The objective function to maximize is the total return on investment:

$$0.05A + 0.06O + 0.03P + 0.08B$$

Subject to the following constraints:

1. $B \leq A$
2. $O \leq P$
3. $B \leq 0.3 \times 300,000 = 90,000$
4. $A + O + P + B \leq 300,000$
5. $A, O, P, B \geq 0$

## Gurobi Code

```python
import gurobi

def solve_investment_problem():
    # Create a new Gurobi model
    model = gurobi.Model()

    # Define the variables
    A = model.addVar(name="Apple", lb=0)
    O = model.addVar(name="Orange", lb=0)
    P = model.addVar(name="Pear", lb=0)
    B = model.addVar(name="Banana", lb=0)

    # Objective function: maximize return on investment
    model.setObjective(0.05 * A + 0.06 * O + 0.03 * P + 0.08 * B, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(B <= A, name="Banana_Apple")
    model.addConstr(O <= P, name="Orange_Pear")
    model.addConstr(B <= 90000, name="Banana_Limit")
    model.addConstr(A + O + P + B <= 300000, name="Total_Investment")

    # Optimize the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal solution found.")
        print(f"Apple: ${A.varValue:.2f}")
        print(f"Orange: ${O.varValue:.2f}")
        print(f"Pear: ${P.varValue:.2f}")
        print(f"Banana: ${B.varValue:.2f}")
        print(f"Total return: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

solve_investment_problem()
```