## Problem Description and Formulation

The problem is an optimization problem with two variables: 'hours worked by Peggy' and 'hours worked by Bobby'. The objective function to be maximized is \(2 \times \text{hours worked by Peggy} + 7 \times \text{hours worked by Bobby}\).

The problem has several constraints:

1. **Individual Ratings Constraints**: These are given and not directly part of the optimization but inform the resource attributes.
   - Peggy: organization score = 4, work quality rating = 15, paperwork competence rating = 19.
   - Bobby: organization score = 14, work quality rating = 24, paperwork competence rating = 2.

2. **Combined Constraints**:
   - Organization score: \(4 \times \text{hours worked by Peggy} + 14 \times \text{hours worked by Bobby} \geq 65\)
   - Work quality rating: \(15 \times \text{hours worked by Peggy} + 24 \times \text{hours worked by Bobby} \geq 22\)
   - Paperwork competence rating: \(19 \times \text{hours worked by Peggy} + 2 \times \text{hours worked by Bobby} \geq 72\)
   - \(-4 \times \text{hours worked by Peggy} + 6 \times \text{hours worked by Bobby} \geq 0\)
   - Organization score (max): \(4 \times \text{hours worked by Peggy} + 14 \times \text{hours worked by Bobby} \leq 119\)
   - Work quality rating (max): \(15 \times \text{hours worked by Peggy} + 24 \times \text{hours worked by Bobby} \leq 59\)
   - Paperwork competence rating (max): \(19 \times \text{hours worked by Peggy} + 2 \times \text{hours worked by Bobby} \leq 199\)

3. **Variable Constraints**:
   - Hours worked by Peggy: Can be a non-integer.
   - Hours worked by Bobby: Must be an integer.

## Gurobi Code Formulation

```python
import gurobipy as gp

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

# Define variables
peggy_hours = m.addVar(name="peggy_hours", lb=0)  # Non-integer, so no specific type needed
bobby_hours = m.addVar(name="bobby_hours", lb=0, type=gp.GRB.INTEGER)  # Integer

# Objective function: Maximize 2*peggy_hours + 7*bobby_hours
m.setObjective(2 * peggy_hours + 7 * bobby_hours, gp.GRB.MAXIMIZE)

# Constraints
m.addConstr(4 * peggy_hours + 14 * bobby_hours >= 65, name="org_score_min")
m.addConstr(15 * peggy_hours + 24 * bobby_hours >= 22, name="work_quality_min")
m.addConstr(19 * peggy_hours + 2 * bobby_hours >= 72, name="paperwork_competence_min")
m.addConstr(-4 * peggy_hours + 6 * bobby_hours >= 0, name="linear_constraint")
m.addConstr(4 * peggy_hours + 14 * bobby_hours <= 119, name="org_score_max")
m.addConstr(15 * peggy_hours + 24 * bobby_hours <= 59, name="work_quality_max")
m.addConstr(19 * peggy_hours + 2 * bobby_hours <= 199, name="paperwork_competence_max")

# Solve the model
m.solve()

# Print the solution
if m.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Peggy hours: {peggy_hours.varValue}")
    print(f"Bobby hours: {bobby_hours.varValue}")
    print(f"Objective: {m.objVal}")
else:
    print("No optimal solution found.")
```