## Problem Description and Formulation

The problem is a linear programming optimization problem. Iota Food wants to maximize viewership by advertising in three areas: grocery stores, train stations, and water parks, with a weekly budget of $50,000.

### Decision Variables

Let \(G\), \(T\), and \(W\) be the number of ads in grocery stores, train stations, and water parks, respectively.

### Objective Function

The objective is to maximize the total viewership. The viewership for each ad is given as 10,000 for grocery stores, 20,000 for train stations, and 50,000 for water parks. Therefore, the objective function can be written as:

\[ \text{Maximize:} \quad 10,000G + 20,000T + 50,000W \]

### Constraints

1. **Budget Constraint:** The total cost of ads should not exceed $50,000. Given that an ad in a grocery store costs $300, in a train station costs $500, and in a water park costs $1000, the budget constraint is:

\[ 300G + 500T + 1000W \leq 50,000 \]

2. **Train Station Ad Limit:** The city limits the number of ads at a train station from a single company to 15:

\[ T \leq 15 \]

3. **Water Park Ad Limit:** At most a third of the total number of ads should be in water parks:

\[ W \leq \frac{1}{3}(G + T + W) \]

   Simplifying, we get:

\[ 2W \leq G + T \]

4. **Grocery Store Ad Minimum:** A minimum of 10% of ads should be in grocery stores:

\[ G \geq 0.1(G + T + W) \]

   Simplifying, we get:

\[ 0.9G \geq 0.1T + 0.1W \]

   Or,

\[ 9G \geq T + W \]

5. **Non-Negativity Constraints:** The number of ads cannot be negative:

\[ G \geq 0, T \geq 0, W \geq 0 \]

## Gurobi Code

```python
import gurobipy as gp

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

# Decision variables
G = m.addVar(name="Grocery", lb=0, vtype=gp.GRB.INTEGER)  # Ads in grocery stores
T = m.addVar(name="Train", lb=0, vtype=gp.GRB.INTEGER)  # Ads in train stations
W = m.addVar(name="Water_Park", lb=0, vtype=gp.GRB.INTEGER)  # Ads in water parks

# Objective: Maximize viewership
m.setObjective(10000*G + 20000*T + 50000*W, gp.GRB.MAXIMIZE)

# Budget constraint
m.addConstr(300*G + 500*T + 1000*W <= 50000, name="Budget")

# Train station ad limit
m.addConstr(T <= 15, name="Train_Limit")

# Water park ad limit
m.addConstr(2*W <= G + T, name="Water_Park_Limit")

# Grocery store ad minimum
m.addConstr(9*G >= T + W, name="Grocery_Min")

# Solve the model
m.optimize()

# Print the solution
if m.status == gp.GRB.OPTIMAL:
    print("Optimal Solution:")
    print(f"Ads in Grocery Stores: {G.varValue}")
    print(f"Ads in Train Stations: {T.varValue}")
    print(f"Ads in Water Parks: {W.varValue}")
    print(f"Max Viewership: {m.objVal}")
else:
    print("The model is infeasible.")
```