## Problem Description and Formulation

The problem requires maximizing an objective function subject to several constraints. The objective function is:

Maximize: $7.28M^2 + 3.0MJ + 3.69J^2 + 8.12M + 8.29J$

where $M$ represents the hours worked by Mary and $J$ represents the hours worked by Jean.

The constraints are:

1. Mary's organization score is 3.15 (fixed).
2. Mary's paperwork competence rating is 2.73 (fixed).
3. Jean's organization score is 3.19 (fixed).
4. Jean's paperwork competence rating is 1.4 (fixed).
5. The total combined organization score from hours worked by Mary and Jean must be at least 5.
6. The total combined paperwork competence rating from hours worked by Mary and Jean must be at least 18.
7. $-M + 7J \geq 0$.
8. The total combined organization score from hours worked by Mary and Jean must be at most 21.
9. The total combined paperwork competence rating from hours worked by Mary and Jean must be at most 36.
10. $M$ must be a whole number (integer).
11. $J$ can be a fractional number.

## Resource Attributes

The resource attributes are given as:
- 'r0': {'description': 'organization score', 'upper_bound': 22, 'x0': 3.15, 'x1': 3.19}
- 'r1': {'description': 'paperwork competence rating', 'upper_bound': 41, 'x0': 2.73, 'x1': 1.4}

## Gurobi Code Formulation

```python
import gurobipy as gp

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

# Define variables
M = model.addVar(name="hours_worked_by_Mary", vtype=gp.GRB.INTEGER)  # Integer variable for Mary's hours
J = model.addVar(name="hours_worked_by_Jean")  # Continuous variable for Jean's hours

# Objective function
model.setObjective(7.28 * M**2 + 3.0 * M * J + 3.69 * J**2 + 8.12 * M + 8.29 * J, gp.GRB.MAXIMIZE)

# Constraints
model.addConstr(3.15 * M + 3.19 * J >= 5, name="org_score_min")  # Organization score minimum
model.addConstr(2.73 * M + 1.4 * J >= 18, name="paperwork_min")  # Paperwork minimum
model.addConstr(-M + 7 * J >= 0, name="jean_mary_ratio")  # Ratio of Jean's to Mary's hours
model.addConstr(3.15 * M + 3.19 * J <= 21, name="org_score_max")  # Organization score maximum
model.addConstr(2.73 * M + 1.4 * J <= 36, name="paperwork_max")  # Paperwork maximum

# Solve the model
model.optimize()

# Print solution
if model.status == gp.GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Hours worked by Mary: {M.varValue}")
    print(f"Hours worked by Jean: {J.varValue}")
    print(f"Objective function value: {model.objVal}")
else:
    print("No optimal solution found.")
```

This code formulates the given optimization problem using Gurobi, solving for the hours worked by Mary and Jean that maximize the specified objective function subject to the provided constraints.