To solve Andrew's problem, we need to formulate a linear programming model that minimizes his cost while meeting the contract requirements. Let's define the decision variables:

* $x_1$: number of days to operate the local farm
* $x_2$: number of days to operate the foreign farm

The objective function is to minimize the total cost, which is given by:

$200x_1 + 500x_2$

The constraints are:

* Raspberries: $2.5x_1 + 5x_2 \geq 12$
* Bilberries: $3x_1 + 4x_2 \geq 10$
* Strawberries: $2x_1 + 4x_2 \geq 20$

We also need to ensure that the number of days to operate each farm is non-negative:

$x_1 \geq 0, x_2 \geq 0$

Now, let's translate this model into Gurobi code in Python:
```python
from gurobipy import *

# Create a new model
m = Model("Berry Farm")

# Define the decision variables
x1 = m.addVar(name="local_farm_days", lb=0)
x2 = m.addVar(name="foreign_farm_days", lb=0)

# Define the objective function
m.setObjective(200*x1 + 500*x2, GRB.MINIMIZE)

# Define the constraints
m.addConstr(2.5*x1 + 5*x2 >= 12, name="raspberries")
m.addConstr(3*x1 + 4*x2 >= 10, name="bilberries")
m.addConstr(2*x1 + 4*x2 >= 20, name="strawberries")

# Optimize the model
m.optimize()

# Print the solution
if m.status == GRB.OPTIMAL:
    print("Optimal solution found:")
    print("Local farm days:", x1.x)
    print("Foreign farm days:", x2.x)
    print("Total cost:", m.objVal)
else:
    print("No optimal solution found")
```