## Problem Description and Formulation

The problem is a classic example of a linear programming problem. The factory produces two types of products: soccer balls and basket balls. Each product has a specific production time on the manufacturing machine and for filling with air. The goal is to maximize profit given the constraints on machine time and air filling time.

Let's define the variables:
- \(S\): Number of soccer balls produced
- \(B\): Number of basket balls produced

The objective function to maximize profit is:
\[ \text{Maximize:} \quad 4S + 5B \]

The constraints are:
1. Manufacturing machine time: \( 5S + 7B \leq 700 \)
2. Air filling time: \( 3S + 4B \leq 500 \)
3. Non-negativity: \( S \geq 0, B \geq 0 \)

## Gurobi Code

To solve this problem, we will use the Gurobi Optimizer in Python. First, ensure you have Gurobi installed in your environment. You can install it via pip:
```bash
pip install gurobi
```

Here's the Gurobi code for the problem:

```python
import gurobi as gp

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

# Define variables
S = model.addVar(name="soccer_balls", lb=0, vtype=gp.GRB.INTEGER)
B = model.addVar(name="basket_balls", lb=0, vtype=gp.GRB.INTEGER)

# Objective function: Maximize profit
model.setObjective(4 * S + 5 * B, sense=gp.GRB.MAXIMIZE)

# Constraints
model.addConstr(5 * S + 7 * B <= 700, name="manufacturing_machine_time")
model.addConstr(3 * S + 4 * B <= 500, name="air_filling_time")

# Solve the model
model.optimize()

# Check if the model is optimized
if model.status == gp.GRB.OPTIMAL:
    print(f"Optimal Solution: Soccer Balls = {S.varValue}, Basket Balls = {B.varValue}")
    print(f"Max Profit: ${model.objVal}")
else:
    print("The model is infeasible or no solution is found.")
```

This code defines the problem in Gurobi, solves it, and prints out the optimal production quantities for soccer balls and basket balls, along with the maximum achievable profit. If the problem is infeasible (i.e., no solution satisfies all constraints), it will indicate that as well.