## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The goal is to maximize the profit of a cleaning company by determining the optimal number of houses and apartments to clean, given the available time for sweeping and mopping.

Let's define the decision variables:

* $H$: the number of houses to clean
* $A$: the number of apartments to clean

The objective function is to maximize the profit:

* Profit per house: $300
* Profit per apartment: $250

The constraints are:

* Sweeping time: 2 hours per house, 1 hour per apartment, and 600 hours available
* Mopping time: 2 hours per house, 1.5 hours per apartment, and 700 hours available

## Mathematical Formulation

The mathematical formulation of the problem is:

Maximize: $300H + 250A$

Subject to:

* $2H + A \leq 600$ (sweeping time constraint)
* $2H + 1.5A \leq 700$ (mopping time constraint)
* $H \geq 0$ and $A \geq 0$ (non-negativity constraints)

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    H = model.addVar(lb=0, name="Houses")
    A = model.addVar(lb=0, name="Apartments")

    # Define the objective function
    model.setObjective(300 * H + 250 * A, gurobi.GRB.MAXIMIZE)

    # Define the constraints
    model.addConstr(2 * H + A <= 600, name="Sweeping_Time")
    model.addConstr(2 * H + 1.5 * A <= 700, name="Mopping_Time")

    # Optimize the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: Houses = {H.varValue}, Apartments = {A.varValue}")
        print(f"Maximum profit: ${model.objVal:.2f}")
    else:
        print("No optimal solution found")

# Run the model
cleaning_company_problem()
```

This code defines the decision variables, objective function, and constraints, and then solves the model using Gurobi's optimization algorithm. The results are printed to the console, including the optimal number of houses and apartments to clean and the maximum profit.