## Problem Description and Formulation

The problem is a linear programming optimization problem. The goal is to maximize the revenue of an underground factory that produces low-quality headsets and keyboards, given certain constraints on space, labor, and costs.

### Variables

- Let \(H\) be the number of square feet allocated for headset production.
- Let \(K\) be the number of square feet allocated for keyboard production.

### Objective Function

The objective is to maximize the net revenue. Headsets produce a net revenue of $45 per sq. foot, and keyboards produce a net revenue of $80 per sq. foot. Therefore, the objective function is:

\[ \text{Maximize:} \quad 45H + 80K \]

### Constraints

1. **Space Constraint:** The factory has 120 sq. feet of space.
\[ H + K \leq 120 \]

2. **Labor Constraint:** Headsets require 2.5 hours of labor per sq. foot, and keyboards require 3.5 hours of labor per sq. foot. The factory wants to spend at most 2500 hours of labor.
\[ 2.5H + 3.5K \leq 2500 \]

3. **Cost Constraint:** Headsets cost $10 per sq. foot for space allocation, and keyboards cost $12 per sq. foot for space allocation. The factory wants to spend at most $5500.
\[ 10H + 12K \leq 5500 \]

4. **Non-Negativity Constraints:** The space allocated for each product cannot be negative.
\[ H \geq 0, K \geq 0 \]

## Gurobi Code

```python
import gurobi

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

    # Variables
    H = model.addVar(lb=0, name="Headset_Space")
    K = model.addVar(lb=0, name="Keyboard_Space")

    # Objective function
    model.setObjective(45 * H + 80 * K, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(H + K <= 120, name="Space_Constraint")
    model.addConstr(2.5 * H + 3.5 * K <= 2500, name="Labor_Constraint")
    model.addConstr(10 * H + 12 * K <= 5500, name="Cost_Constraint")

    # Optimize
    model.optimize()

    # Status
    if model.status == gurobi.GRB.Status.OPTIMAL:
        print("Optimal Solution:")
        print(f"Headset Space: {H.varValue} sq. feet")
        print(f"Keyboard Space: {K.varValue} sq. feet")
        print(f"Max Revenue: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

# Run the optimization
optimize_factory_layout()
```

This code defines the optimization problem using Gurobi's Python interface, sets up the variables, objective function, and constraints according to the problem description, and then solves the problem. If an optimal solution is found, it prints out the optimal space allocations for headsets and keyboards and the maximum achievable revenue.