## Problem Description and Formulation

The problem is a linear programming optimization problem. Tom can take two types of shots: slow shots worth 3 points each and quick shots worth 6 points each. The goal is to maximize Tom's total score under the given constraints.

### Constraints:

1. **Total Shots**: Tom can take at most 20 shots in total.
2. **Minimum Slow Shots**: Tom must take at least 8 slow shots.
3. **Minimum Quick Shots**: Tom must take at least 5 quick shots.
4. **Maximum Slow or Quick Shots**: Due to time restrictions, Tom can take at most 12 slow shots or 12 quick shots.

### Decision Variables:

- \(S\): The number of slow shots Tom takes.
- \(Q\): The number of quick shots Tom takes.

### Objective Function:

Maximize the total score: \(3S + 6Q\)

### Constraints in Mathematical Form:

1. \(S + Q \leq 20\)
2. \(S \geq 8\)
3. \(Q \geq 5\)
4. \(S \leq 12\)
5. \(Q \leq 12\)
6. \(S, Q \geq 0\) and are integers (though Gurobi can handle continuous variables, we'll ensure integrality as per the problem context)

## Gurobi Code

```python
import gurobi

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

    # Define the variables
    S = model.addVar(lb=0, ub=12, name="Slow_Shots", vtype=gurobi.GRB.INTEGER)
    Q = model.addVar(lb=0, ub=12, name="Quick_Shots", vtype=gurobi.GRB.INTEGER)

    # Objective function: Maximize 3S + 6Q
    model.setObjective(3 * S + 6 * Q, gurobi.GRB.MAXIMIZE)

    # Constraints
    model.addConstr(S + Q <= 20, name="Total_Shots")
    model.addConstr(S >= 8, name="Min_Slow_Shots")
    model.addConstr(Q >= 5, name="Min_Quick_Shots")
    model.addConstr(S <= 12, name="Max_Slow_Shots")
    model.addConstr(Q <= 12, name="Max_Quick_Shots")

    # Update model
    model.update()

    # Solve the problem
    model.optimize()

    # Print the results
    if model.status == gurobi.GRB.OPTIMAL:
        print(f"Optimal slow shots: {S.varValue}")
        print(f"Optimal quick shots: {Q.varValue}")
        print(f"Max score: {3 * S.varValue + 6 * Q.varValue}")
    else:
        print("The problem is infeasible")

solve_problem()
```