## Problem Description and Formulation

The cosmetics company wants to invest in short commercial spots on two types of programs: social media and television. The goal is to meet the advertising requirements at minimum cost. The requirements are:

- Each social media commercial is seen by 5 million young girls and 1 million middle-aged women.
- Each television commercial is seen by 3 million young girls and 7 million middle-aged women.
- A 1-minute social media ad costs $30,000.
- A 1-minute television ad costs $50,000.
- The company wants the commercials to be seen by at least 20 million young girls and 30 million middle-aged women.

## Mathematical Formulation

Let's denote:
- \(x\) as the number of social media commercials.
- \(y\) as the number of television commercials.

The objective function to minimize the total cost is:
\[ \text{Minimize:} \quad 30,000x + 50,000y \]

Subject to the constraints:
\[ 5x + 3y \geq 20 \] (for young girls)
\[ x + 7y \geq 30 \] (for middle-aged women)
\[ x \geq 0, y \geq 0 \] (non-negativity constraints)

## Gurobi Code

```python
import gurobi

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

    # Define variables
    x = model.addVar(name="social_media_commercials", lb=0, vtype=gurobi.GRB.CONTINUOUS)
    y = model.addVar(name="television_commercials", lb=0, vtype=gurobi.GRB.CONTINUOUS)

    # Objective function: Minimize cost
    model.setObjective(30000*x + 50000*y, gurobi.GRB.MINIMIZE)

    # Constraints
    model.addConstr(5*x + 3*y >= 20, name="young_girls_constraint")
    model.addConstr(x + 7*y >= 30, name="middle_aged_women_constraint")

    # Optimize
    model.optimize()

    # Print solution
    if model.status == gurobi.GRB.OPTIMAL:
        print("Optimal solution found.")
        print(f"Number of social media commercials: {x.varValue}")
        print(f"Number of television commercials: {y.varValue}")
        print(f"Minimum cost: ${model.objVal:.2f}")
    else:
        print("No optimal solution found.")

solve_advertising_problem()
```