## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The goal is to maximize the profit of a sandwich store by determining the optimal number of meatball sandwiches and ham sandwiches to produce, given the available resources (meat, cheese, and sauce).

Let's define the decision variables:

* $x_1$: number of meatball sandwiches
* $x_2$: number of ham sandwiches

The objective function is to maximize the total profit:

* Profit per meatball sandwich: $3
* Profit per ham sandwich: $3.50
* Total profit: $3x_1 + 3.50x_2$

The constraints are:

* Meat: 25 grams per meatball sandwich, 30 grams per ham sandwich, and 4000 grams available
* Cheese: 10 grams per meatball sandwich, 25 grams per ham sandwich, and 5000 grams available
* Sauce: 50 grams per meatball sandwich, 20 grams per ham sandwich, and 5200 grams available
* Non-negativity: $x_1 \geq 0, x_2 \geq 0$

## Mathematical Formulation

The mathematical formulation of the problem is:

Maximize: $3x_1 + 3.50x_2$

Subject to:

* $25x_1 + 30x_2 \leq 4000$ (meat constraint)
* $10x_1 + 25x_2 \leq 5000$ (cheese constraint)
* $50x_1 + 20x_2 \leq 5200$ (sauce constraint)
* $x_1 \geq 0, x_2 \geq 0$ (non-negativity constraints)

## Gurobi Code

```python
import gurobi

# Create a new Gurobi model
m = gurobi.Model()

# Define the decision variables
x1 = m.addVar(lb=0, name="meatball_sandwiches")
x2 = m.addVar(lb=0, name="ham_sandwiches")

# Define the objective function
m.setObjective(3 * x1 + 3.50 * x2, gurobi.GRB.MAXIMIZE)

# Add the constraints
m.addConstr(25 * x1 + 30 * x2 <= 4000, name="meat_constraint")
m.addConstr(10 * x1 + 25 * x2 <= 5000, name="cheese_constraint")
m.addConstr(50 * x1 + 20 * x2 <= 5200, name="sauce_constraint")

# Optimize the model
m.optimize()

# Print the solution
if m.status == gurobi.GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Meatball sandwiches: {x1.varValue}")
    print(f"Ham sandwiches: {x2.varValue}")
    print(f"Max profit: {m.objVal}")
else:
    print("No optimal solution found.")
```