## Problem Description and Formulation

The energy drink company wants to maximize viewership by advertising their product using three types of commercials: with famous actors, with regular people, and with no people. Each type of commercial has a given cost and expected viewership. The company has several constraints:
- The cost of each type of commercial: $10,000 for famous actors, $3,000 for regular people, and $2,000 for no people.
- The expected viewership of each type: 50,000 for famous actors, 20,000 for regular people, and 18,000 for no people.
- The company can make at most 3 commercials with regular actors.
- At most a third of all commercials must be commercials with no people.
- At least 20% of commercials should be commercials with famous actors.
- The weekly budget is $50,000.

## Formulation as a Linear Programming Problem

Let's denote:
- \(x_1\) as the number of commercials with famous actors,
- \(x_2\) as the number of commercials with regular people,
- \(x_3\) as the number of commercials with no people.

The objective is to maximize viewership:
\[ \text{Maximize:} \quad 50000x_1 + 20000x_2 + 18000x_3 \]

Subject to:
1. Budget constraint: \( 10000x_1 + 3000x_2 + 2000x_3 \leq 50000 \)
2. Constraint on commercials with regular actors: \( x_2 \leq 3 \)
3. Constraint on commercials with no people: \( x_3 \leq \frac{1}{3}(x_1 + x_2 + x_3) \)
4. Constraint on commercials with famous actors: \( x_1 \geq 0.2(x_1 + x_2 + x_3) \)
5. Non-negativity constraints: \( x_1, x_2, x_3 \geq 0 \) and are integers.

## Gurobi Code

To handle the constraints and the objective function, we will use Gurobi's Python interface. Note that we need to adjust the constraints to fit Gurobi's requirement for linear constraints.

```python
import gurobi as gp
from gurobi import GRB

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

# Define variables
x1 = model.addVar(vtype=GRB.INTEGER, name="famous_actors")
x2 = model.addVar(vtype=GRB.INTEGER, name="regular_people")
x3 = model.addVar(vtype=GRB.INTEGER, name="no_people")

# Objective function: Maximize viewership
model.setObjective(50000*x1 + 20000*x2 + 18000*x3, GRB.MAXIMIZE)

# Budget constraint
model.addConstr(10000*x1 + 3000*x2 + 2000*x3 <= 50000, name="budget_constraint")

# Constraint on commercials with regular actors
model.addConstr(x2 <= 3, name="regular_people_constraint")

# Constraint on commercials with no people
model.addConstr(3*x3 <= x1 + x2 + x3, name="no_people_constraint")
model.addConstr(2*x3 <= x1 + x2, name="no_people_constraint_adjusted")

# Constraint on commercials with famous actors
model.addConstr(x1 >= 0.2*(x1 + x2 + x3), name="famous_actors_constraint")
model.addConstr(0.8*x1 >= 0.2*x2 + 0.2*x3, name="famous_actors_constraint_adjusted")
model.addConstr(4*x1 >= x2 + x3, name="famous_actors_constraint_final")

# Non-negativity constraints (handled by variable type)

# Solve the model
model.optimize()

# Print solution
if model.status == GRB.OPTIMAL:
    print("Optimal solution found.")
    print(f"Famous actors commercials: {x1.varValue}")
    print(f"Regular people commercials: {x2.varValue}")
    print(f"No people commercials: {x3.varValue}")
else:
    print("No optimal solution found.")
```