## Problem Description and Formulation

The problem is a linear programming optimization problem where the goal is to maximize the total points earned from solving easy and hard questions in an exam. The constraints are as follows:

- Each easy question is worth 4 points, and each hard question is worth 10 points.
- At least 4 easy questions and 2 hard questions must be solved to pass.
- Due to time restrictions, no more than 12 easy questions and 4 hard questions can be solved.
- The total number of questions that can be solved is at most 9.

## Symbolic Representation

Let's denote:
- \(E\) as the number of easy questions to be solved.
- \(H\) as the number of hard questions to be solved.

The objective function to maximize the total points is:
\[ \text{Maximize:} \quad 4E + 10H \]

Subject to the constraints:
1. \( E \geq 4 \)
2. \( H \geq 2 \)
3. \( E \leq 12 \)
4. \( H \leq 4 \)
5. \( E + H \leq 9 \)

## Gurobi Code

```python
import gurobi

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

    # Define the variables
    E = model.addVar(lb=0, ub=12, name="Easy_Questions")
    H = model.addVar(lb=0, ub=4, name="Hard_Questions")

    # Objective function: Maximize 4E + 10H
    model.setObjective(4 * E + 10 * H, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(E >= 4, name="Min_Easy")
    model.addConstr(H >= 2, name="Min_Hard")
    model.addConstr(E <= 12, name="Max_Easy")
    model.addConstr(H <= 4, name="Max_Hard")
    model.addConstr(E + H <= 9, name="Total_Questions")

    # Optimize the model
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal solution: Easy questions = {E.varValue}, Hard questions = {H.varValue}")
        print(f"Maximum points: {4 * E.varValue + 10 * H.varValue}")
    else:
        print("No optimal solution found.")

solve_exam_problem()
```