## Problem Description and Formulation

The problem requires maximizing the objective function: $6.35P + 3.95H + 9.82M$, where $P$, $H$, and $M$ represent the hours worked by Paul, Hank, and Mary, respectively.

Subject to the following constraints:

1. Work quality ratings: $r_P = 0.95$, $r_H = 0.55$, $r_M = 0.72$.
2. $0.95P + 0.55H \geq 24$.
3. $0.95P + 0.55H + 0.72M \geq 16$.
4. $0.95P + 0.72M \leq 61$.
5. $0.95P + 0.55H + 0.72M \leq 61$.
6. $P$, $H$, and $M$ are non-negative integers.

## Gurobi Code

```python
import gurobipy as gp

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

# Define variables
P = m.addVar(name="Paul_hours", vtype=gp.GRB.INTEGER)
H = m.addVar(name="Hank_hours", vtype=gp.GRB.INTEGER)
M = m.addVar(name="Mary_hours", vtype=gp.GRB.INTEGER)

# Objective function
m.setObjective(6.35*P + 3.95*H + 9.82*M, gp.GRB.MAXIMIZE)

# Constraints
m.addConstr(0.95*P + 0.55*H >= 24, name="Min_Quality_P_H")
m.addConstr(0.95*P + 0.55*H + 0.72*M >= 16, name="Min_Quality_All")
m.addConstr(0.95*P + 0.72*M <= 61, name="Max_Quality_P_M")
m.addConstr(0.95*P + 0.55*H + 0.72*M <= 61, name="Max_Quality_All")

# Solve the model
m.optimize()

# Print the solution
if m.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Paul's hours: {P.varValue}")
    print(f"Hank's hours: {H.varValue}")
    print(f"Mary's hours: {M.varValue}")
    print(f"Objective: {m.objVal}")
else:
    print("No optimal solution found")
```