## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The goal is to maximize the profit of a furniture store that produces desks and chairs from two different manufacturers, subject to several constraints.

### Decision Variables

Let \(D_x\) be the number of desks produced by Manufacturer X, \(D_y\) be the number of desks produced by Manufacturer Y, \(C_x\) be the number of chairs produced by Manufacturer X, and \(C_y\) be the number of chairs produced by Manufacturer Y.

### Objective Function

The profit per desk is $140, and the profit per chair is $120. The objective function to maximize the total profit (\(P\)) is:

\[P = 140(D_x + D_y) + 120(C_x + C_y)\]

### Constraints

1. **Manufacturer X's Desk Production Limit**: Manufacturer X can make at most 22 desks a day.
\[D_x \leq 22\]

2. **Manufacturer Y's Chair Production Limit**: Manufacturer Y can make at most 28 chairs a day.
\[C_y \leq 28\]

3. **Quality Checking Limit**: The quality checking company can check at most 40 items of either type per day.
\[D_x + D_y + C_x + C_y \leq 40\]

4. **Non-Negativity Constraints**: The number of desks and chairs produced cannot be negative.
\[D_x, D_y, C_x, C_y \geq 0\]

## Gurobi Code

```python
import gurobi

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

    # Define the decision variables
    D_x = model.addVar(lb=0, ub=22, name="D_x")  # Desks by Manufacturer X
    D_y = model.addVar(lb=0, name="D_y")  # Desks by Manufacturer Y
    C_x = model.addVar(lb=0, name="C_x")  # Chairs by Manufacturer X
    C_y = model.addVar(lb=0, ub=28, name="C_y")  # Chairs by Manufacturer Y

    # Objective function: Maximize profit
    model.setObjective(140 * (D_x + D_y) + 120 * (C_x + C_y), gurobi.GRB.MAXIMIZE)

    # Quality checking limit
    model.addConstr(D_x + D_y + C_x + C_y <= 40, name="Quality_Checking_Limit")

    # Solve the model
    model.optimize()

    # Print the solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal Solution:")
        print(f"Desks by Manufacturer X: {D_x.varValue}")
        print(f"Desks by Manufacturer Y: {D_y.varValue}")
        print(f"Chairs by Manufacturer X: {C_x.varValue}")
        print(f"Chairs by Manufacturer Y: {C_y.varValue}")
        print(f"Max Profit: {model.objVal}")
    else:
        print("The model is infeasible.")

solve_optimization_problem()
```