## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The goal is to maximize the profit of a hardware manufacturer by determining the optimal number of CPUs and GPUs to produce, given constraints on wiring and soldering time.

Let's define the decision variables:

* $x$: number of CPUs to produce
* $y$: number of GPUs to produce

The objective function is to maximize the profit:

* Profit per CPU: $300
* Profit per GPU: $500
* Total profit: $300x + 500y

The constraints are:

* Wiring time: 30 minutes per CPU, 90 minutes per GPU, at most 2000 minutes available
* Soldering time: 50 minutes per CPU, 40 minutes per GPU, at most 2500 minutes available
* Non-negativity: $x \geq 0, y \geq 0$

## Mathematical Formulation

The mathematical formulation of the problem is:

Maximize: $300x + 500y$

Subject to:

* $30x + 90y \leq 2000$ (wiring time constraint)
* $50x + 40y \leq 2500$ (soldering time constraint)
* $x \geq 0, y \geq 0$ (non-negativity constraints)

## Gurobi Code

```python
import gurobipy as gp

# Create a new model
model = gp.Model("cpu_gpu_production")

# Define the decision variables
x = model.addVar(name="cpu", lb=0, vtype=gp.GRB.INTEGER)  # number of CPUs to produce
y = model.addVar(name="gpu", lb=0, vtype=gp.GRB.INTEGER)  # number of GPUs to produce

# Define the objective function
model.setObjective(300*x + 500*y, gp.GRB.MAXIMIZE)

# Define the constraints
model.addConstr(30*x + 90*y <= 2000, name="wiring_time_constraint")
model.addConstr(50*x + 40*y <= 2500, name="soldering_time_constraint")

# Solve the model
model.optimize()

# Print the solution
if model.status == gp.GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Number of CPUs to produce: {x.varValue}")
    print(f"Number of GPUs to produce: {y.varValue}")
    print(f"Maximum profit: ${model.objVal:.2f}")
else:
    print("No optimal solution found.")
```